const obj = {
name: "John",
getName: function() {
return this.name
}
}
console.log("Type", typeof(obj.getName()))
const obj2 = {
roll: 2,
desig: "Software developer",
name : "Peter",
_proto_: obj
}
console.log(obj2.getName())
Question posted in Javascript
A very good W3school tutorial can be found here.
A very good W3school tutorial can be found here.
2
Answers
__proto__
with two underscores on each side, not one.It should be
__proto__
not_proto_