Created
December 30, 2020 15:20
-
-
Save Jagathishrex/0aba7dbcfae8bb1440a71fa406e7804f to your computer and use it in GitHub Desktop.
This file contains hidden or 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
"use strict"; | |
let user = { name : "Jagathish" }; | |
Object.preventExtensions(user); | |
// user.age = 23; --> this will throw error | |
user.__proto__.age = 23; // adding property to object prototype | |
console.log(user); // {name : "Jagathish"} | |
console.log(user.age); // 23 --> this value comes from object prototype property |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment