I am having trouble understanding delete operation in javascript.
I have an object like follows -
var object = {"name" : "abc"};
object.prototype = {"name" : "xyz"};
If I delete the "name" property from object it should delete it from the object and not from the prototype as the prototype values are only used in get operation.
So after -
delete object.name
If I print object.name it gives me 'undefined', while in my opinion it should give me 'xyz'.
First i thought that the delete operation is just setting the value of object.name to 'undefined', but then object.hasOwnProperty('name') gives me false.
Am I missing anything?
object.nameandobject.prototype.name