Quiz 13: Prototype and new
Question 1
Shows
true?JavaScript
const Empty = (() => {
function Empty() {}
return Empty;
}) ();
const empty = Empty;
empty instanceof EmptyQuestion 2
Shows
true?JavaScript
const Empty = (() => {
function Empty() {}
return Empty;
}) ();
const empty = new Empty;
empty instanceof EmptyQuestion 3
Shows
true?JavaScript
const Empty = (() => {
function Empty() {}
return Empty;
}) ();
const empty = new Empty;
const also = new Empty;
Empty.prototype.answer = 42;
empty.answer === 42 && also.answer === 42Question 4
Shows
true?JavaScript
function Empty() {}
const empty = new Empty();
Empty.prototype.answer = 42;
empty.answer === 42