Array plus array

PHOTO EMBED

Tue Oct 04 2022 10:10:17 GMT+0000 (Coordinated Universal Time)

Saved by @j_jivan #javascript

/*I'm new to coding and now I want to get the sum of two arrays... Actually the sum of all their elements. I'll appreciate for your help.

P.S. Each array includes only integer numbers. Output is a number too.
*/
function arrayPlusArray(arr1, arr2) {
  return [...arr1, ...arr2].reduce((sum, element)=>{
    return sum+= element;
  }, 0)
}
content_copyCOPY

https://www.codewars.com/kata/5a2be17aee1aaefe2a000151/train/javascript