I get the entire logic of the reduce method, and rest parameter, however I really don’t get the importance of 0. Thank you very much in advance!
const sum = (...args) => {
return args.reduce((a,b) => a + b, 0);
}
Blancer.com Tutorials and projects
Freelance Projects, Design and Programming Tutorials
I get the entire logic of the reduce method, and rest parameter, however I really don’t get the importance of 0. Thank you very much in advance!
const sum = (...args) => {
return args.reduce((a,b) => a + b, 0);
}