Skip to content

Instantly share code, notes, and snippets.

@steven-ferguson
Created January 22, 2014 21:41
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 steven-ferguson/8567906 to your computer and use it in GitHub Desktop.
Save steven-ferguson/8567906 to your computer and use it in GitHub Desktop.
Object.create vs new Object with object literal notation
var Foo = {
prop: 'A'
}
var bar = Object.create(Foo);
var bad = new Object(Foo);
//These are false
console.log(Foo === bar);
console.log(bar === bad);
//But this is true
console.log(Foo === bad);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment