i was digging throug some code (async module for nodejs) and ran into the following notation:
return fn.apply(null, [async.forEachSeries].concat(args));
if seen this notation using the square brackets alot, but have no idea whoat it means exactly.
is this related to ES5?
greetings!
It’s really quite simple. You are basically gluing two arrays together and passing the resulting array as second argument to apply. See:
https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/concat
e.g.: