Hacker Timesnew | past | comments | ask | show | jobs | submitlogin

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);


Incrementing undefined gives NaN. You're going to want to initialize that i to 0.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: