I was reading on the differences between the __proto__
and the prototype
object, but when I tried to access the __proto__
of an instance of an object, it returned me undefined
.
Following is the code I wrote:
function Student() {
}
var student = new Student();
student.constructor // works well returns function Student() {}
student.__proto__ // returns undefined.
I was referring this blog but I saw other blogs too that show the same. We never get the prototype on the instance of an object but __proto__
object instead that was created using the prototype
property.
Am I missing something or __proto__
has been removed entirely? I've tested this on Chrome version 40.0.2214.94 on Linux.
Any help appreciated. Thanks!