Re:Ask HN: How to prepare for a Front-end Developer interview?
by zeven7 on Sunday August 14, 2016 @11:15PM
(#12288411)
Tip: You can stick to `const` when declaring `i` in the loop header (at least as far as the ES spec is concerned -- mileage may vary on current implementations / transpilers).
[ Parent
| on HN ]
Re:Ask HN: How to prepare for a Front-end Developer interview?
by epimetheus on Monday August 15, 2016 @09:20AM
(#12290205)
If you set `i` as a constant it can't be changed, so it'll always remain 0. (the loop will end immediately after the first iteration with an error so no infinite loop)