JavaScript Optimization: “Speed Up Object Detection”

This is a simulated test case for JavaScript Tip #1: Speed Up Object Detection. View source for the test code. I'm aware the test case could be improved, for example by running each case 10 times and calculating an average, but it's 1am now...

Run the test.