4 ms·
While I enjoy the creativity of his for loops, javascript is the not language to be doing this in. One of the key advantages of using a foreach loop with a call
by chewbranca 16y ago
While I enjoy the creativity of his for loops, javascript is the not language to be doing this in. One of the key advantages of using a foreach loop with a callback function, is that javascript has functional scope. All of those variable declarations in his for loops are just for show, so personally I think the while loops in his examples are more appropriate for javascript as it doesn't fool you into thinking it has block scope.