Guest practice: this set is not saved and does not count.
What does this log?
console.log(typeof [], typeof function () {}, typeof "hi");
A method is a property whose value is a function.
Setting a property to undefined (pet.color = undefined) removes the key, exactly like delete pet.color.
undefined
pet.color = undefined
delete pet.color
const account = { balance: 100, deposit(amount) { this.balance += amount; return this.balance; } }; account.deposit(50); console.log(account.deposit(25));
const dog = { name: "Rex", speak() { return this.name; } }; const fn = dog.speak.bind({ name: "Max" }); console.log(fn(), dog.speak());
Click a question to go back and check it. After you submit, you will see the right answer and an explanation for every question. As a guest, nothing is saved.
Check my answers