I was trying to create object different way and trying to observe prototype property of the object created in each way.
var a = {a: 1};
//The prototype chain as mentioned in [here][1]
// a ---> Object.prototype ---> null
Now, i have observed that a.prototype is undefined. Question1:If it is undefined then how the prototype chain is formed? a.hasOwnProperty exist because of prototype chain.
Now if i say:
var myFunc = function(){};
// Prototype chain: myFunc ---> Function.prototype ---> Object.prototype ---> null
for this way of creation, myFunc.prototype exist.
Question2: Why this difference exist?