You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit f437c13
Browse filesBrowse the repository at this point in the historyBrowse files
ProtoType: If we can inherit the property of the one class to other class called as Inheritence.
2743
+
2744
+
const objName = {
2745
+
name : "priya",
2746
+
getName : function(){
2747
+
return this.name; //wanted to access above name inside block so we used "this"
2748
+
}
2749
+
}
2750
+
console.log("1",objName.getName());
2751
+
2752
+
const objState = {
2753
+
//name: "riya",
2754
+
state : "pune",
2755
+
__proto__ : objName
2756
+
}
2757
+
console.log("2",objState.getName()); //if will find in current object, if not available then it move to upper object continuously. If still not found then it will give undefined.
0 commit comments