user
List three methods to calculate the sum of the elements of an array. Output:
assistant
Three methods to calculate the sum of the elements of an array are: 
1. Using a for loop to iterate through the array and add all the elements.
2. Using the reduce() method to reduce the array to a sum.
3. Using the built-in array.prototype.sum() method.