I use Firefox.
This code logs [].
[]
var log = console.log; function new_comb(aComb) { var res = []; log(aComb); // <- This is
console.log shows live data, not a snapshot of the object at the time you run it.
console.log
Since you splice all the data out of the array, it is empty almost as soon as you log it.
splice
Stringify or deep copy the array if you want to log a snapshot of it.