Skip to content

Instantly share code, notes, and snippets.

@hawx1993
Created October 9, 2017 02:39
Show Gist options
  • Select an option

  • Save hawx1993/87d9d5829c78e93dcf2f6a06ee6cd599 to your computer and use it in GitHub Desktop.

Select an option

Save hawx1993/87d9d5829c78e93dcf2f6a06ee6cd599 to your computer and use it in GitHub Desktop.
plain JavaScript objects
var _toString = Object.prototype.toString;
/**
* Strict object type check. Only returns true
* for plain JavaScript objects.
*/
function isPlainObject (obj) {
return _toString.call(obj) === '[object Object]'
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment