{ All snippets }

Tweetsnippet is a curated list of tips and tricks from Twitter.

Rich Harris

Rich Harris @Rich_Harris

just learned a neat trick from the Three.js source code: if you want to remove an item from an array whose order doesn't matter, don't do this... array.splice(index, 1); // slooooowwwww ...do this: array[i] = array[array.length - 1]; array.pop(); // orders of magnitude faster!