Skip to content

Instantly share code, notes, and snippets.

@kcjpop
Last active August 29, 2015 13:58
Show Gist options
  • Save kcjpop/9982753 to your computer and use it in GitHub Desktop.
Save kcjpop/9982753 to your computer and use it in GitHub Desktop.
Some JavaScript notes
// Check existence of a property
Object.prototype.hasOwnProperty.call(obj, keyToBeChecked);
// Create a new object that inherits from a null prototype
var registry = Object.create(null);
// So this could yield `true`
!registry['hasOwnProperty'];
// Source: http://www.devthought.com/2012/01/18/an-object-is-not-a-hash/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment