Convert Arguments Into An Array

Super easy, one line method!

JavaScript
function do_something() {

  var args = [].slice.call(arguments, 0);
  console.log(args);
  
};

do_something(1, 2, 3);
Output
[1, 2, 3]

Oct 11 2009

Convert Arguments Into An Array

An easy, one line way to convert a function's Arguments into an array.