Eda Eren

  • JavaScript

When multiple arguments are passed to `unshift`, they are inserted as a chunk

If you pass multiple arguments to unshift(), they are not inserted one by one, but as a chunk:

let a = []; // []
a.unshift(1, 2) // [1, 2] -- not [2, 1]
let a = []; // []
a.unshift(1, 2) // [1, 2] -- not [2, 1]