Skip to content

Instantly share code, notes, and snippets.

@debugmodedotnet
Created December 29, 2017 09:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save debugmodedotnet/25d712a0e653ef11972d4f21aa6b68cc to your computer and use it in GitHub Desktop.
Save debugmodedotnet/25d712a0e653ef11972d4f21aa6b68cc to your computer and use it in GitHub Desktop.
var car = {
model: 'bmw',
color: 'red',
price: 2000
}
Object.defineProperty(car, "type", {
writable: true,
enumerable: true,
configurable: false,
value: 'gas'
});
console.log(car.type); //gas
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment