Skip to content

Instantly share code, notes, and snippets.

@leohxj
Created August 2, 2013 03:36
Show Gist options
  • Save leohxj/6137329 to your computer and use it in GitHub Desktop.
Save leohxj/6137329 to your computer and use it in GitHub Desktop.
JS判断变量是否是数组
isArray = ('isArray' in Array) ? Array.isArray : function(value) {
return Object.prototype.toString.call(value) === '[object Array]';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment