string literals in js code example

Example 1: javascript template literals

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

Example 2: template literals javascript

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

Example 3: string literals

Things a string says you should take a face value, without poetic inference
If there is a dollar brace - like the other grepper answer below...
you have a TEMPLATE LITERAL and SHOULD look for hidden meaning.

Example 4: ${ js

`string text`

`string text line 1
 string text line 2`

`string text ${expression} string text`

tag `string text ${expression} string text`

Example 5: javascript strin literal

const stringLiteral = `text string ${expression} text string`;

Example 6: string literals javascript

`string text`

`string text line 1
 string text line 2`

`string text ${expression} string text`

tag`string text ${expression} string text`