Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

reduce in js

var totalYears = pilots.reduce(function (accumulator, pilot) {
  return accumulator + pilot.years;
}, 0);
Source by medium.com #
 
PREVIOUS NEXT
Tagged: #reduce #js
ADD COMMENT
Topic
Name
6+1 =