Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

simple method

var total = [0, 1, 2, 3].reduce((a, b)=> a + b,0);
// total == 6
Source by developer.mozilla.org #
 
PREVIOUS NEXT
Tagged: #simple #method
ADD COMMENT
Topic
Name
4+4 =