sum array reduce function

by Craig Martin

JavaScript

arr = [1.45, 200, 30, 40];
sum= arr.reduce(function (a, b) {return a + b;}, 0);

alert(sum);