function a(b) {
var array = Array.prototype.slice.call(b);
console.log(array);
var array_two = ???;
console.log(array_two);
}
a([1, 2, 3], 1, 2);
console.log(array);
gives me output [1, 2, 3]
as expected.
What I want to achieve here is getting [1, 2]
- numbers after [ ], joined as array. I thought that b[number]
would solve the problem. b[0]
- array, b[1]
- first number after array, b[2]
- second number after array but apparently it does not work like that. Do you know any solution for that?