//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);
const subject = 'world';
console.log(`hello ${subject}`);
// output = 'hello world'
function hello(firstName, lastName) {
return `Good morning ${firstName} ${lastName}!
How are you?`
}
console.log(hello('Ranjeet', 'Andani'))
const name = 'JavaScript';
console.log(`I love ${name}`); // I Love JavaScript