You need to loop over each of the individual array and then sum it's element and return a new array.
For returning new array you can use map & for calculating the sum use reduce
var array = [
[1],
[2, 1, 1],
[3, 4]
];
let m = array.map(function(item) {
return item.reduce(function(acc, curr) {
acc += curr;
return acc;
}, 0)
})
console.log(m)