I am pretty new to javascript.I am confused with javascript reduce. this is my array value
var result = [
[ 0, 4, 22 ]//26,
[ 0, 9, 19 ]//28
]
I want to add this array value like this..
[
[26],
[28]
]
And again I have to add this value like this..
26+28=54
this is my try this gives me undefined..
var sum = result.map((data) => {
data.reduce(function (total ,curr) {
return total+curr
})
});
console.log(sum)