0

I know what this code will do:

( (...args)=>console.log(args) )( [1,2,3], [4,5,6,7,8] )

But I have bumped into another use, and I couldn't find what this means because I have no idea what to name it. I checked MDN's IIFE page, but it has no mention of this.

( 0, (...args)=>console.log(args) )( [1,2,3], [4,5,6,7,8] )

I tried to use different numbers and a function as that first argument but the result is not affected. Then I tried to put a variable in there and used it in the second fine (the function) but it polluted the global.


original code I saw is in @Jest/core's TestScheduler.js file.

(0, _testResult().addResult)(aggregatedResults, testResult);
Yılmaz Durmaz
  • 1,457
  • 9
  • 21

0 Answers0