const result = [1,2,3,4,5].reduce((acc,cur) => (acc[+(cur % 2 !== 0)] += cur, acc), [0, 0])
console.log(result)
It is supposed to sum up the even values and the odd values in the array but how can we have 2 different initializers for the initial values? There are 2 commas at the end of the reduce method, how do they work in this case?
[+(boolean expression)]doesn't make sensetrueandfalsekeys.