task-sum-array.js 160 B

123456
  1. // task-sum-array
  2. let arr = [1, 2, 3, 4,10];
  3. let sum = 0;
  4. for (let item of arr) { sum = sum+item };
  5. // console.log(arr.concat(sum));
  6. console.log([...arr,sum]);