String interpolation

Do you remember those times when you needed to concatenate a string using the + operator? It won’t be necessary anymore. For example, the following code concatenates string1 and string2 using the + operator:

let string1 = "JavaScript";
let string2 = "awesome";
let string3 = string1 + " " + string2

Now, let's look at how interpolation helps us write simpler code:

let string1 = "JavaScript";
let string2 = "awesome";
let string3 = `${string1} ${string2}`
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset