Created
February 12, 2015 11:41
-
-
Save f3r/17ac2398a4b144b37156 to your computer and use it in GitHub Desktop.
Everything is an object!
This file contains 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 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