Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js for loop plus number

var nums = ['100','300','400','60','40'],
    sum = nums.reduce(function(accum, val) {return accum + Number(val);}, 0);
alert(sum);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #js #loop #number
ADD COMMENT
Topic
Name
2+7 =