We're a place where coders share, stay up-to-date and grow their careers.
Nice article.
//sum of array elements arr.reduce((accumulator, currentValue) => (acc += curr), 0)
should be:
//sum of array elements arr.reduce((accumulator, currentValue) => (accumulator += currentValue), 0)
Changed it. Thank you :)
Nice article.
//sum of array elements
arr.reduce((accumulator, currentValue) => (acc += curr), 0)
should be:
//sum of array elements
arr.reduce((accumulator, currentValue) => (accumulator += currentValue), 0)
Changed it. Thank you :)