string with variables interpolation javascript code example
Example 1: string interpolation in javascript
const number = 42;
const message = `The number is ${number}`;
message; // => 'The number is 42'
Example 2: #{} js
let value = dummy`Ik ben ${name} en ik ben ${age} jaar`;
function dummy() {
let str = "";
strings.forEach((string, i) => {
str += string + values[i];
});
return str;
}