5 ms·
Additionally, this will log all the passed arguments (value, index, and array being traversed), which typically isn't what you want: [1, 2, 3].forEach(cons
by willyg302 12y ago
Additionally, this will log all the passed arguments (value, index, and array being traversed), which typically isn't what you want:
[1, 2, 3].forEach(console.log.bind(console));
> 1 0 [1, 2, 3]
> 2 1 [1, 2, 3]
> 3 2 [1, 2, 3]