Skip to content

Instantly share code, notes, and snippets.

@yiyizym
Created April 27, 2017 10:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yiyizym/42a1f1e6b51aeaf13a7d2c2088f5606e to your computer and use it in GitHub Desktop.
Save yiyizym/42a1f1e6b51aeaf13a7d2c2088f5606e to your computer and use it in GitHub Desktop.
isArray.js
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