Challenge 1
Create an object that delegates to base.
const base = { theme: "dark" };
const settings = ;
Press Ctrl⌘Enter to check your answer
Practice prototype creation, property ownership, lookup, shared methods, and descriptors.
Challenge 1
const base = { theme: "dark" };
const settings = ;
Press Ctrl⌘Enter to check your answer
Challenge 2
const item = Object.create({ title: "inherited" });
item.name = "Guide";
const result = Object.(item, "title");
Press Ctrl⌘Enter to check your answer
Challenge 3
const base = { role: "admin" };
const user = Object.create(base);
const result = "role" user;
Press Ctrl⌘Enter to check your answer
Challenge 4
const base = {};
const child = Object.create(base);
const result = Object.(child);
Press Ctrl⌘Enter to check your answer
Challenge 5
function User(name) { this.name = name; }
User.prototype. = function () { return this.name; };
Challenge 6
const proto = { count: 0 };
const object = Object.create(proto);
object. = 3;
Press Ctrl⌘Enter to check your answer
Challenge 7
const box = {};
Object.defineProperty(box, "value", { value: 1, });
Press Ctrl⌘Enter to check your answer
Challenge 8
const dictionary = Object.(null);
Press Ctrl⌘Enter to check your answer