function list() {
return Array.prototype.slice.call(arguments, 0); //I'm struggling to understand this line
}
var list1 = list(1, 2, 3); // [1, 2, 3]
I stumbled upon this code snippet showcasing the slice method and I'm curious about how the call() function can iterate through each argument provided to the list function using the "arguments" property.
I am puzzled by how passing just the "arguments" property as the context for the slice() function results in accessing all the items. Is there some recursion happening that I'm not seeing?