- 31.3k
- 22
- 110
- 134
The easiest way to make multiline strings in JavaScript is with the use of backticks (``). This allows you to create multiline strings in which you can insert variables with ${variableName}.
Example:
let name = 'Willem';
let age = 26;
let multilineString = `
my name is: ${name}
my age is: ${age}
`;
console.log(multilineString);
Compatibility:
- It was introducesintroduced in ES6/ES2015
- It is now natively supported by all major browser vendors (except internet explorerInternet Explorer)
Check the exact compatibility in Mozilla documentation here.
The easiest way to make multiline strings in JavaScript is with the use of backticks (``). This allows you to create multiline strings in which you can insert variables with ${variableName}.
Example:
let name = 'Willem';
let age = 26;
let multilineString = `
my name is: ${name}
my age is: ${age}
`;
console.log(multilineString);
Compatibility:
- It was introduces in ES6/ES2015
- It is now natively supported by all major browser vendors (except internet explorer)
Check the exact compatibility in Mozilla documentation here.
The easiest way to make multiline strings in JavaScript is with the use of backticks (``). This allows you to create multiline strings in which you can insert variables with ${variableName}.
Example:
let name = 'Willem';
let age = 26;
let multilineString = `
my name is: ${name}
my age is: ${age}
`;
console.log(multilineString);
Compatibility:
- It was introduced in ES6/ES2015
- It is now natively supported by all major browser vendors (except Internet Explorer)
Check the exact compatibility in Mozilla documentation here.
- 31.3k
- 22
- 110
- 134
EasiestThe easiest way to make multiline strings in JavascripsJavaScript is with the use of backticks ( `` ``). This allows you to create multiline strings in which you can insert variables with ${variableName}.
Example:
let name = 'Willem';
let age = 26;
let multilineString = `
my name is: ${name}
my age is: ${age}
`;
console.log(multilineString);
compatibility Compatibility:
- It was introduces in
ES6/ES6/es2015ES2015 - It is now natively supported by all major browser vendors (except internet explorer)
Check the exact compatibility in Mozilla docsdocumentation here .
Easiest way to make multiline strings in Javascrips is with the use of backticks ( `` ). This allows you to create multiline strings in which you can insert variables with ${variableName}.
Example:
let name = 'Willem';
let age = 26;
let multilineString = `
my name is: ${name}
my age is: ${age}
`;
console.log(multilineString);
compatibility :
- It was introduces in
ES6//es2015 - It is now natively supported by all major browser vendors (except internet explorer)
The easiest way to make multiline strings in JavaScript is with the use of backticks (``). This allows you to create multiline strings in which you can insert variables with ${variableName}.
Example:
let name = 'Willem';
let age = 26;
let multilineString = `
my name is: ${name}
my age is: ${age}
`;
console.log(multilineString);
Compatibility:
- It was introduces in ES6/ES2015
- It is now natively supported by all major browser vendors (except internet explorer)
Check the exact compatibility in Mozilla documentation here .
Easiest way to make multiline strings in Javascrips is with the use of backticks ( `` ). This allows you to create multiline strings in which you can insert variables with ${variableName}.
Example:
Example:
let name = 'Willem';
let age = 26;
let multilineString = `
my name is: ${name}
my age is: ${age}
`;
console.log(multilineString);
compatibility :
- It was introduces in
ES6//es2015 - It is now natively supported by all major browser vendors (except internet explorer)
Easiest way to make multiline strings in Javascrips is with the use of backticks ( `` ). This allows you to create multiline strings in which you can insert variables with ${variableName}.
Example:
let name = 'Willem';
let age = 26;
let multilineString = `
my name is: ${name}
my age is: ${age}
`;
console.log(multilineString);
Easiest way to make multiline strings in Javascrips is with the use of backticks ( `` ). This allows you to create multiline strings in which you can insert variables with ${variableName}.
Example:
let name = 'Willem';
let age = 26;
let multilineString = `
my name is: ${name}
my age is: ${age}
`;
console.log(multilineString);
compatibility :
- It was introduces in
ES6//es2015 - It is now natively supported by all major browser vendors (except internet explorer)