checkedresponsive[@]gmail.com

Menu

Sum of array values in Javascript

How to sum of array values in Javascript ?

Sample :-

array.reduce(function(a,b){return a + b;},0)

Example :- 

let invoiceAmount = [1000, 1500, 2000];

invoiceAmount.reduce(function(a,b){return a + b;},0);

The above code return if the array is NULL and return the calculate value.

Sum of array values in Javascript

Packers and Movers in Dubai

Leave a Reply

Your email address will not be published. Required fields are marked *