7 8 template literals c2 b6

Solutions on MaxInterview for 7 8 template literals c2 b6 by the best coders in the world

showing results for - "7 8 template literals c2 b6"
Djibril
14 May 2017
1/*Template literals allow for the automatic insertion of expressions
2(including variables) into strings.
3
4While normal strings are enclosed in single or double quotes 
5(' or "), template literals are enclosed in back-tick characters,
6 `. Within a template literal, any expression surrounded by ${ } 
7 will be evaluated, with the resulting value included in the string.
8
9Template literals allow for variables and other expressions to be 
10directly included in strings.*/
11
12let name = "Jack";
13let currentAge = 9;
14
15console.log(`Next year, ${name} will be ${currentAge + 1}.`);
16
17//Next year, Jack will be 10.
18
19//Example2: 
20let poem = `The mind chases happiness.
21The heart creates happiness.
22The soul is happiness
23And it spreads happiness
24All-where.
25
26– Sri Chinmoy`;
27
28console.log(poem);
29
30/*The mind chases happiness.
31The heart creates happiness.
32The soul is happiness
33And it spreads happiness
34All-where.
35
36– Sri Chinmoy
similar questions
queries leading to this page
7 8 template literals c2 b6