//Template strings allow you to inject values into a string while
//preserving the format. Your code becomes more reader friendly.
//Use it instead of 'string arithmetic'.
let userName = 'John Doe';
let finalResult = 234;
//template string
console.log(`Hello ${userName} your final result is ${finalResult}`);
//'string arithmetic'
console.log("Hello " + userName + " your final result is " + finalResult);
//Template strings allow you to inject values into a string while
//preserving the format. Your code becomes more reader friendly.
//Use it instead of 'string arithmetic'.
let userName = 'John Doe';
let finalResult = 234;
//template string
console.log(`Hello ${userName} your final result is ${finalResult}`);
//'string arithmetic'
console.log("Hello " + userName + " your final result is " + finalResult);
/*
The template string is indicated with a dollar sign and curly brackets
(${expression}) inside the backtick symbol.
*/
//Template String
const name = 'Muhammad Shahnewaz';
const result = `${name} is a good boy`;
console.log(result); //Muhammad Shahnewaz is a good boy
/*
The template string is indicated with a dollar sign and curly brackets
(${expression}) inside the backtick symbol.
*/
//Template String
const name = 'Muhammad Shahnewaz';
const result = `${name} is a good boy`;
console.log(result); //Muhammad Shahnewaz is a good boy