Strings & Characters

In JavaScript there is no data type for a single character.

Single or Double Quote

Strings you can use single or double quotes

let string1 = "some ' text";  
let string2 = 'some " text';
let string3 = `some text`;

There is no difference between the single and double quotes.
Backticks were added in ES 2015 to provide another way of writing a string literal.

There is no multi-line string syntax
new line \n
string literal delimiter \" or \'
unicode characters \u00A9

escape characters \" for double quotes
backslash single quote
backslash double quote


Property - Description
constructor - Returns the string's constructor function
length - Returns the length of a string
prototype - Allows you to add properties and methods to an object

Pattern Matching

regular expressions
search, replace, extract

Methods - exec, test

© 2019 Better Solutions Limited. All Rights Reserved. © 2019 Better Solutions Limited TopNext