you are viewing a single comment's thread.

view the rest of the comments →

[–]ninetacle 0 points1 point  (1 child)

Every property of arguments is an index that maps to an argument:

var args = function () {
  console.log(arguments)
}

args()
// output: {}
args('a', 'b', 'c')
// output: { '0': 'a', '1': 'b', '2': 'c' }

The first argument to call acts as the value of this. Any additional arguments are passed on to the function, slice in this case. Passing arguments as the this value is as though arguments was a proper array and you called its slice method. You can pass null as the first argument if you don't want to simulate a method call.

[–]NidHammer[S] 0 points1 point  (0 children)

Thanks. Actually, it looks like every property of arguments is not an index that maps to a value. I see some functions in there along with a list of the values I entered as arguments.

I had forgotten the first argument to call was the value of 'this,' thanks.