Skip to content

Instantly share code, notes, and snippets.

@marksiemers
Created March 1, 2017 04:26
Show Gist options
  • Save marksiemers/731b9b5d759725357e57522fc9958725 to your computer and use it in GitHub Desktop.
Save marksiemers/731b9b5d759725357e57522fc9958725 to your computer and use it in GitHub Desktop.
Function to check if objects are arrays
function isArray(obj) {
return (typeof obj !== "undefined"
&& obj !== null
&& obj.constructor === Array)
}
function areArrays() {
if (arguments.length === 0){ return null }
for (i = 0; i < arguments.length; i++) {
if (!isArray(arguments[i])) { return false }
}
return true
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment