const obj = { foo: 1 };
obj.bar = 2;
const speed = 'quick'; `The ${speed} brown fox jumps over the lazy dog.`
let name = 'Harry';
let occupation = 'wizard';
console.log(`Hi! My name is ${name}. I'm a ${occupation}.`);
(function() {
let f = this ? class g { } : class h { };
return [ typeof f, typeof h ];
})();
typeof (new (class F extends (String, Array) { })).substring
(function() {
if (false) {
let f = { g() => 1 };
}
return typeof f;
})()
const PI = 3.14;
console.log(PI) //Prints 3.14
let titleElements = document.querySelectorAll('.article .title') let titles = Array.from(titleElements).map( t => t.textContent ); console.log(titles);
class Slave { // ... };
const slave = Slave();