I am new to JS and I wonder why this piece of code prints false. What am I doing wrong? Thank you for any hint!
var x = Object.create(Object.prototype, {x:{value:3, writable:true, enumerable:true}});
console.log(x.propertyIsEnumerable(x)); //false
Well, you missed the quotes:
x.propertyIsEnumerable('x')
See below:
var x = Object.create(Object.prototype, {x:{value:3, writable:true, enumerable:true}});
console.log(x.propertyIsEnumerable('x'));