Specifically, how does the expression inside of the reduce() method work?
const sum = (...args) => args.reduce((a, b) => a + b, 0)
Which arguments is it supposed to accept and what values are ‘a’ and ‘b’ assigned?
Specifically, how does the expression inside of the reduce() method work?
const sum = (...args) => args.reduce((a, b) => a + b, 0)
Which arguments is it supposed to accept and what values are ‘a’ and ‘b’ assigned?
why don’t you search the reduce method on google and read about it, and then tell us if there is something you don’t understand?