Mavengers
Developer's Blog
Tuesday, April 21, 2015
jquery calculate sum of array elements
var sum = 0;
var array = [1, 2, 3, 4, 5];
$.each(array, function (index, value) {
sum = sum + value;
});
alert(sum);
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment