thecasualcoder/godash

Add Reduce function

aswinkarthik opened this issue · 0 comments

API:

input := []int{1,2,3,4,5}

accumulator := 0 // initialize accumulator
godash.Reduce(input, &accumulator, func(acc, each int) int {
    return acc + each
})

// accumulator should be 15