3 ms·
In the first example, he creates a unique closure per point instance and places it on the point itself. In the second example, he creates a single closure and
by munificent 13y ago
In the first example, he creates a unique closure per point instance and places it on the point itself.
In the second example, he creates a single closure and places it on the point's prototype.
Unsurprisingly, creating one object is faster than creating a thousand of them. I'm not sure why the author thinks this has anything to do with closures.