string interpolation javascript
snippet in javascript

string interpolation javascript

user4604

const age = 3
console.log(`I'm ${age} years old!`)

javascript string interpolation

user526

var animal = "cow";
var str=`The ${animal} jumped over the moon`; // string interpolation

javascript template literals

user2299

//Regular string
var rgb = "rgb(" + r + "," + g + "," + b + ")";
//Template literal
var rgb = `rgb(${r}, ${g}, ${b})`;

string interpolation in javascript

user5394

const number = 42;
const message = `The number is ${number}`;

message; // => 'The number is 42'

template literals javascript

user5423

// TEMPLATE LITERALS example
console.log(`Hi, I'm ${p.name}! Call me "${p.nn}".`);

string literal javascript

user2121

`string text`

`string text line 1
 string text line 2`

`string text ${expression} string text`

tag`string text ${expression} string text`