Last active
July 26, 2021 09:36
-
-
Save eamon0989/fc17553a2a687629e6f3a2a253d86895 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let obj = {}; | |
console.log(Object.prototype); // [Object: null prototype] {} | |
console.log(Object.getPrototypeOf(obj)); // [Object: null prototype] {} | |
console.log(Object.prototype === Object.getPrototypeOf(obj)); // true | |
console.log(Object.prototype.isPrototypeOf(obj)); // true | |
Object.prototype.foo = 'Hey there!'; | |
console.log(Object.prototype); // [Object: null prototype] { foo: 'Hey there!' } | |
console.log(obj.foo); // Hey there! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment