Tell us what’s happening:
Who can explain the following question to me?
- Why
arr = [1, 2, 3, 1, 2, 3]
while I pass[1, 2, 3, 1, 2, 3], 2, 3
into functiondestroyer(arr)
? I think it will bearr = [[1, 2, 3, 1, 2, 3], 2, 3]
. - What is the difference between
Array.prototype.slice.call(arguments)
andArray.from(arguments)
?
Thank you so much!!!
Your code so far
function destroyer(arr) {
console.log(arr);
console.log(Array.prototype.slice.call(arguments));
console.log(Array.from(arguments));
}
destroyer([1, 2, 3, 1, 2, 3], 2, 3);
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) coc_coc_browser/80.0.180 Chrome/74.0.3729.180 Safari/537.36
.
Link to the challenge: