DEV Community

[Comment from a deleted post]
Collapse
 
psfr937 profile image
raymond

For your es7 for loop examples, the if condition seems to be redundant, so first one is better xD

Collapse
 
ycmjason profile image
YCM Jason

Ya, I couldn't think of a way of doing that elegantly. I think the recursive solution in ES7 is the most elegant.