String Templates
regular string concatenation in Javascript prior to ES6 was:
let a=3;
let b=5;
console.log('The sum of ' + a + ' and ' + b +
' is ' + (a + b) + ' and not ' + (a*b) + '.'')
which is very hard to write, read and understand
In ES6, JavaScript has evolved in the string concatenation and since , using string templates
let a=3;
let b=5;
console.log(`The sum of ${a} and ${b} is ${a + b}
and not ${a * b} .`)
NOTES:
- 1: ` (backtick) and not ' (tick) is used for wrapping of the text!!!
- 2: the string inside ` is a MultiLine string!!
An Arrow function does not create his own object and does not have their own context
Using 'this' reference will alwats refer to the window level
back to main page