'This is a string. 👏';
"This is the 2nd string. 💁";
Enclosing Quotation Marks
"It's six o'clock.";
'Remember to say "please" and "thank you."';
Here’s what that looks like reusing the examples above:
'It\'s six o\'clock.';
"Remember to say \"please\" and \"thank you.\"";
Strings have their own built-in variables and functions, also known as properties and methods. Here are some of the most common ones.
A string’s length property keeps track of how many characters it has.
A string’s toUpperCase method returns a copy of the string with its letters converted to capitals. Numbers, symbols, and other characters are not affected.
"I wish I were big.".toUpperCase();
"I WISH I WERE BIG."
A string’s trim method returns a copy of the string with beginning and ending whitespace characters removed.