JS `` ``
`string text ${expression} string text`
Nervous Nightingale
`string text ${expression} string text`
const age = 3
console.log(`I'm ${age} years old!`)
`string text`
`string text line 1
string text line 2`
`string text ${expression} string text`
tag`string text ${expression} string text`
// ` ` or a string literal allows you to include javascript in a string easily
a = 3
//instead of:
console.log("the value of a is " + a)
//you can use a string literal:
console.log("the value of a is ${a}")
//you can use javascript
a = 3
b= 5
console.log("a is ${a}, b is ${b}, and a plus b is ${a + b}.")