Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
38 lines (24 loc) · 655 Bytes

File metadata and controls

38 lines (24 loc) · 655 Bytes
Copy raw file
Download raw file
Edit and raw actions

Creation

You can define strings in JavaScript by enclosing the text in single quotes or double quotes:

// Single quotes can be used
var str = 'Our lovely string';

// Double quotes as well
var otherStr = "Another nice string";

In Javascript, Strings can contain UTF-8 characters:

"中文 español English हिन्दी العربية português বাংলা русский 日本語 ਪੰਜਾਬੀ 한국어";

Note: Strings can not be subtracted, multiplied or divided.


Create a variable named str set to the value "abc".

var str = 'abc';
assert(str === 'abc');

Morty Proxy This is a proxified and sanitized view of the page, visit original site.