'use strict';
function MakeObj() {
const x = 1;
}
MakeObj.prototype = { x: 4 };
const obj1 = new MakeObj();
const obj2 = new MakeObj();
obj2.__proto__ = obj1;
MakeObj.prototype = null;
console.log(obj2.x);
What will the console output be?
The string MakeObj.prototype = null; did not affect obj1 and obj2 objects, because the references inside the __proto__ ([[Prototype]]) properties remained the same.
obj1.__proto__ has reference to the { x: 4 }, and obj2.__proto__ has reference to the obj1.