Skip to content

JS Strings

Syntax

Strings in JavaScript are sequences of characters enclosed in single ('), double ("), or backtick (`) quotes.

let singleQuoteString = 'Hello World';
let doubleQuoteString = "Hello World";

Example

const empty = '';
const character = 'H';
const word = 'Hello';
const phrase = 'Hello World';
const sentence = 'Hello, World!';
// These are still strings because of the quotes
// even though they look like other data types
const numberString = '42';
const booleanString = 'true';