let name = 'Harry';
let occupation = 'wizard';
console.log(`Hi! My name is ${name}. I'm a ${occupation}.`);
[...[...'...']].length
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) // Печатает 3.14
let some_text = "some string";
if(some_text.indexOf('str') !=-1){
return true;
}
let titleElements = document.querySelectorAll('.article .title'); let titles = Array.from(titleElements).map( t => t.textContent ); console.log(titles);
let a = 12, b = 3;
[a, b] = [b, a];
class Slave { // ... };
const slave = Slave();