I was exploring prototype in JavaScript.
function A () { this.x = 7; };
function B () {};
B.prototype = new A();
var b = new B();
b.x; // => 7
// But why is it giving 'false' below
b.hasOwnProperty('x'); // => false
My Query is,
is it correct code?
If 'b' is has a value for 'x' , then it should be its property. If so, why is it giving false.
Please clarify.