JS

JavaScript ES6 - Template literals code snippet ex...

25.

What will be the output of the following code snippet?

const name = 'John';
const age = 30;
console.log(`My name is ${name} and I am ${age} years old.`);

ReferenceError: name is not defined.

My name is undefined and I am undefined years old.

My name is ${name} and I am ${age} years old.

My name is John and I am 30 years old.