Hacker News new | past | comments | ask | show | jobs | submit login

A slightly better reason: creating closures is (comparatively) slow. I recently switched from a closure model to a prototype model in my main js lib; a quick series of tests in Chromium gave me a 13% speed increase in my core functions using the prototype approach.

This roughly matches what I read elsewhere, e.g. http://macwright.org/2013/01/22/javascript-module-pattern-me...




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: