Skip to content

Instantly share code, notes, and snippets.

@johnmmoss
Last active July 1, 2016 15:15
Show Gist options
  • Select an option

  • Save johnmmoss/d5daea2afdc6e807438fa826b42c24a7 to your computer and use it in GitHub Desktop.

Select an option

Save johnmmoss/d5daea2afdc6e807438fa826b42c24a7 to your computer and use it in GitHub Desktop.
Creating an object using Object.create
'use strict'
var monkey = Object.create(Object.prototype,
{
name: {
value: "Hansel",
writable: true,
enumerable: true,
configurable: true
},
color: {
value: "Brown",
writable: true,
enumerable: true,
configurable: true
}
});
console.log(monkey.name); // Hansel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment