console.log([..."hello"]);
const obj = {
a: 1,
b: 2,
a: 3
};
console.log(obj.a);
const arr = [1, 2, 3];
arr[10] = 11;
console.log(arr.length);
const name = "Alice";
const obj = {
name: "Bob",
getName() {
return this.name;
}
};
console.log(obj.getName.call({ name: "Charlie" }));
const sym1 = Symbol("id");
const sym2 = Symbol("id");
console.log(sym1 === sym2);
let name = "Alice";
(function() {
let name = "Bob";
console.log(name);
})();
console.log(name);
??=
nullish coalescing assignment operator snuck into JavaScript a few years ago via ECMAScript 2021 and has been broadly supported almost everywhere for ages. Trevor shows off how it can tighten up your assignments here.