Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Lately, instead of using the module pattern by invoking a function immediately and returning an object, I've taken to just using an anonymous function/constructor with the new operator -- properties defined under "this" will be public and any other variables will be private (obviously). I prefer it over the typical "module pattern" because I believe it looks just a tad bit cleaner compared to the explicit object definition.


Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

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

Search: