3 ms·
I find it easier -- clearer -- to get rid of the enumerable early. var i, order, totals = []; for(; order=orders[i]; i++) totals.push(order.total);
by thezilch 14y ago
I find it easier -- clearer -- to get rid of the enumerable early.
var i, order, totals = [];
for(; order=orders[i]; i++) totals.push(order.total);
- jwmerrill 14y agoIncrementing undefined gives NaN. You're going to want to initialize that i to 0.
- deleted 14y ago[deleted]