godash
godash copied to clipboard
Add Flatten function
API:
array1 := []int{1,2,3}
array2 := []int{4,5,6}
array3 := []int{7,8,9}
var ouput []int
godash.Flatten(&output, array1, array2, array3)
// output should be []int{1,2,3,4,5,6,7,8,9}
Flatten can easily be implemented using consecutive append
calls. I am having doubts if flatten will help @arunvelsriram
I think it's okay since lodash
is providing it even though it could be achieved by a series of concat()
.
a = [1,2,3]
b = [4,5,6]
c = [7, 8, 9]
d = a.concat(b).concat(c)
// d = [ 1, 2, 3, 4, 5, 6, 7, 8, 9 ]
@arunvelsriram @aswinkarthik I can take this up.
Sure go ahead.
@aswinkarthik could you share the deep flatten idea we discussed offline?