Guest practice: this set is not saved and does not count.
What does this log?
const s = new String("hi"); console.log(typeof s, s === "hi", typeof String(42));
const user = { name: "Ava", tags: ["js"] }; const copy = { ...user }; copy.name = "Zed"; copy.tags.push("css"); console.log(user.name, user.tags);
new Math() works and creates a new math object, just like new Date() creates a new date.
new Math()
new Date()
console.log(typeof mystery); try { console.log(mystery); } catch (e) { console.log(e.name); }
object
undefined
ReferenceError
function greet(name = "friend") { return "Hi, " + name; } console.log(greet(), greet(undefined), greet(null));
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