Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

return the sum of an array

[0, 1, 2, 3, 4].reduce(function(accumulateur, valeurCourante, index, array){
  return accumulateur + valeurCourante;
}, 10);
Source by developer.mozilla.org #
 
PREVIOUS NEXT
Tagged: #return #sum #array
ADD COMMENT
Topic
Name
8+3 =