Refactoring - Notes
Notes
- Pipelining
// return sum of even nums
const nums = [1,2,3]
const even = nums.filter(num => num % 2 == 0)
.reduce( (acc, curVal) => {
return acc + curVal
}, 0)
// return sum of even nums
const nums = [1,2,3]
const even = nums.filter(num => num % 2 == 0)
.reduce( (acc, curVal) => {
return acc + curVal
}, 0)