Hacker Times
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
thezilch
on April 2, 2013
|
parent
|
context
|
favorite
| on:
Explicit vs. Clever
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
on April 3, 2013
[–]
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: