for (var i = 0; i < salaries.length; i++) { }, 0); You can use the reduce() method to find or calculate the sum of an array of numbers. In this tutorial we are going to explain how you can create array and access it’s element. on javaScript Sum Array Object Values – Examples, javaScript Difference Between Two Dates in Years Months Days, JavaScript Array: Remove Element from Array. This expression usually initializes one or more loop counters, but the syntax allows an expression of any degree of complexity. expenditure value. Here will take e.g.