Skip to content

Instantly share code, notes, and snippets.

@kalisjoshua
Last active August 29, 2015 14:18
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 kalisjoshua/f30b58b40af6c64b6b6d to your computer and use it in GitHub Desktop.
Save kalisjoshua/f30b58b40af6c64b6b6d to your computer and use it in GitHub Desktop.
// What does this code achieve?
function toArray(args) {
return Array.prototype.slice.call(args);
}
// When would you use it? Why does it need to be implemented this way? And what about the following code?
function log(args) {
Function.prototype.apply.call(console.log, console, args);
}
// Again, what might be the purpose of doing it this way?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment