Intern — Middle
Implementation of a function that calculates the sum of array elements
livecode
Task condition
You need to write a function that calculates the total sum of all elements in the given array, using any method you know.
const arr = [1, 2, 3, 4, 5]
The function should take an array as an argument and return a number – the sum of its elements.