Careeroza
String Basics
Creating Strings
Example
Strings can use single quotes, double quotes or backticks. They are immutable: methods return new strings.
const a = 'single';
const b = "double";
const c = `backtick`;
const quote = "She said \"hi\""; // escaping
console.log(a, b, c, quote);
console.log("Careeroza".length);
console.log("Careeroza"[0], "Careeroza".at(-1));Output
single double backtick She said "hi" 9 C a
Escape Characters
| Code | Result |
|---|---|
\n | new line |
\t | tab |
\\ | backslash |
\", \' | quotes |