I created an instance of Shape using Object.create() method and tried accessing the property of Shape as follows, but the inherited property becomes undefined
:
function Shape(){
this.x = 10;
this.y = 20;
}
var rectangle = Object.create(Shape);
console.log(rectangle.x) // undefined