Created
November 3, 2014 14:48
-
-
Save dalemanthei/0d96876156bb9efba5a5 to your computer and use it in GitHub Desktop.
Check if JavaScript variable is an array
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
// http://stackoverflow.com/questions/4775722/check-if-object-is-array | |
if( Object.prototype.toString.call( someVar ) === '[object Array]' ) { | |
alert( 'Array!' ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment