Skip to content

Instantly share code, notes, and snippets.

@borestad
Created June 7, 2012 10:50
Show Gist options
  • Save borestad/2888170 to your computer and use it in GitHub Desktop.
Save borestad/2888170 to your computer and use it in GitHub Desktop.
isPlainObject()
function isPlainObject(val){
return val.toString() === "[object Object]";
}
isPlainObject({}) // => true
isPlainObject([]) // => false
isPlainObject(function(){}) // => false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment