I don't understand the call function in javascript
function multiply(){
console.log(arguments);
console.log([].slice.call(arguments));
}
console.log(multiply(2,3));
The above function prints
// [Arguments] { '0': 2, '1': 3 }
// [ 2, 3 ]
So I see the value passed to call function is an following object
//[Arguments] { '0': 2, '1': 3 }
So I tried the following but it prints empty array,
function multiple(){
console.log(arguments);
console.log([].slice.call({ '0': 2, '1': 3 }));
}
console.log(multiple(2,3));
// [Arguments] { '0': 2, '1': 3 }
// []
Can anybody explain me why the call works in first case, and why it is not working in second case?
How exactly call and slice work?