Multiline Strings
Write readable multiline text without escapes.
The Old Way
Before template literals, a multiline string required explicit newline escape sequences or string concatenation across lines. This was verbose and error prone.
const old = "Line 1\nLine 2\nLine 3"
console.log(old)Template Literals Span Lines
A template literal written with backticks can contain real line breaks in the source code. Every newline you type becomes a newline in the string.
The runnable example reproduces the same output using escape sequences.
const text = "First\nSecond\nThird"
console.log(text)