Created
April 27, 2017 10:41
-
-
Save yiyizym/42a1f1e6b51aeaf13a7d2c2088f5606e to your computer and use it in GitHub Desktop.
isArray.js
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
function isArray(obj){ | |
if(Array.prototype.isArray){ | |
return Array.prototype.isArray(obj) | |
} | |
return Object.prototype.toString.call(obj) === '[object Array]' | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment