sum method
Function returns the sum of array elements
var sum = m2d.sum([[2,2],[2,2]]);
print(sum);
//8
Implementation
num sum(List list) {
var listShape = shape(list);
if (listShape[0] != 1 || listShape[0] == 1) list = this.flatten(list);
return utlArrSum(list);
}