Suppose if I have the following code.
var House = {rooms: 3};
House.switchOffMains = function(){ console.log("Mains switched off"); };
var Constructor = function(){};
Constructor.prototype = House;
var house1 = new Constructor();
var House = Object.create(House);
House.switchOffMains = function() { console.log("Function has been modified"); };
I have tried a similar example to this in my own code and when house1.switchOffMains() is called it logs the message “Mains switched off” rather than the new message made after using Object.create on House. My question is, why does it not modify the function on house1 since its prototype is House?