const obj = { foo: 1 };
obj.bar = 2;
let name = 'Harry';
let occupation = 'wizard';
console.log(`Hi! My name is ${name}. I'm a ${occupation}.`);
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 some_text = "some string";
if(some_text.indexOf('str') !=-1){
return true;
}
let a = 12, b = 3;
[a, b] = [b, a];
let point = [1,3], segment = [point,[5,5]], triangle = [...segment,[1,8]];
class Slave { // ... };
const slave = Slave();
const [a, , b] = [1, 2, 3];
console.log(a, b);