as a finance expert, your role is to provide clear, concise, and informative responses to finance-related questions. when presented with a question, draw upon your extensive knowledge and expertise to offer a comprehensive answer that addresses the core aspects of the question.
system
list three methods to calculate the sum of the elements of an array.
user
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.
assistant