Skip to content

Instantly share code, notes, and snippets.

@f3r
Created February 12, 2015 11:41
Show Gist options
  • Save f3r/17ac2398a4b144b37156 to your computer and use it in GitHub Desktop.
Save f3r/17ac2398a4b144b37156 to your computer and use it in GitHub Desktop.
Everything is an object!
var stuff = [42, "forty-two", [], {}, (function(){}) ];
var isAnObject = false;
for(var i=0; i < stuff.length; i++) {
isAnObject = stuff[i] instanceof Object;
console.log(stuff[i].constructor + ' instanceof Object? ' + isAnObject);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment