Literals

String literal

Try the free JavaScript compiler

A quoted string literal creates a String value. Matching single or double quotes delimit text, with escapes available for special characters. The delimiter characters are not included in the value.

Formal Syntax & Structure

javascript syntaxjavascript
"text"

Return Value

string

Text represented by the literal.

Working Example

Example Snippetjavascript
console.log('hello');
JavaScript Reference