Skip to content

Instantly share code, notes, and snippets.

@kriscooke
Last active August 29, 2015 14:18
Show Gist options
  • Select an option

  • Save kriscooke/8863c0aaf0f2fce1a957 to your computer and use it in GitHub Desktop.

Select an option

Save kriscooke/8863c0aaf0f2fce1a957 to your computer and use it in GitHub Desktop.
JS: Validate/Coerce arguments object to an array
function needsArray(a){
var args = Array.isArray(a)? a : Array.prototype.slice.call(arguments);
// Now, use args as an array
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment