This story is unavailable.

Very nice tips!

Regarding #5. When I know an array is well formed (i.e. no falsy values at any index) I usually prefer to assign the item of the array directly in the loop.

Like this: for(var i = 0, item; item = a[i]; i++) console.log(item);

(If the array can contain falsy values, this slightly more verbose version works better: for(var i = 0, item; (item = a[i]) != undefined; i++) console.log(item); )

Like what you read? Give Fredrik Schiller a round of applause.

From a quick cheer to a standing ovation, clap to show how much you enjoyed this story.