Guest practice: this set is not saved and does not count.
What does this log?
console.log(typeof [], typeof function () {}, typeof "hi");
What happens when this runs?
const user = { name: "Ada" }; user.age = 36; user = { name: "Alan" }; console.log(user.name);
SyntaxError
Alan
Ada
TypeError
An arrow function is a good choice for a method that needs to read the object's own properties with this.
this
"User: " + {a: 1} gives "User: [object Object]", but console.log("User:", {a: 1}) shows the object's contents.
"User: " + {a: 1}
"User: [object Object]"
console.log("User:", {a: 1})
function Student(name) { this.name = name; } const oops = Student("Dee"); console.log(oops);
Student {name: "Dee"}
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