Created
October 9, 2017 02:39
-
-
Save hawx1993/87d9d5829c78e93dcf2f6a06ee6cd599 to your computer and use it in GitHub Desktop.
plain JavaScript objects
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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