MY #100 DAYS OF CODE CHALLENGE JOURNEY-DAY 11

IMG_20190209_130735.jpg

We are still on my 100days of code challenge journey. As my learning of JavaScript ES6 continues, I learned the amazing functions of a template literal.

Template literal is an alternative for outputting without using single or double quotes. It uses a backtick and makes printing on screen easily manipulated.

Example

`go to
school`

\\prints go to
\\prints school

If we were to write the above output using single or double quotes we will require a newline character \n to print "school" on a new line.

Template literal also makes it possible to use a placeholder(${name}), a dollar sign followed by two curly brackets inside a string without the need to concatenate.

Example

var name = "Wright";

``my firstname is ${name}`

// Prints my firstname is Wright

H2
H3
H4
3 columns
2 columns
1 column
Join the conversation now
Logo
Center