I need to sum all my numbers from a for loop with javascript
var nums = ['100','300','400','60','40'];
for(var i=1; i < nums.length; i++){
var num = nums[i] + nums[i];
alert(num);
}
can someone help http://jsfiddle.net/GYpd2/1/
the outcome i am looking for is 900
num
. I recommend to read the MDN JavaScript Guide to learn the basics.