Can Anyone tell me what will be the prototype of an simple object when that object is created using Object Literal Notation/ Object.create ? When i went through MDN Notes on Object.create it was stated something like below
var a = {a: 1};
// a ---> Object.prototype ---> null
var b = Object.create(a);
// b ---> a ---> Object.prototype ---> null
console.log(b.a); // 1 (inherited)
var c = Object.create(b);
// c ---> b ---> a ---> Object.prototype ---> null
var d = Object.create(null);
// d ---> null
console.log(d.hasOwnProperty); // undefined, because d doesn't inherit from Object.prototype
But Whenever i tried console.log(b.prototype) it gave me undefined, same with the case of "c" and "d" Object. I am confused here, if b's prototype is "a" according to MDN, then why is it giving undefined.
One more question, if b.prototype is undefined, then how come console.log(b.a); is resulting 1. How is it inheriting in this case ?