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

This works even cooler when you want to minify your code:

MyLongClassName = function() {};

function(_c) { _c.prototype.method1 = ...; _c.prototype.method2 = ...; }(MyLongClassName);

This allows something like YUI compressor to shorten _c local variable for every method definition, rather than store "MyLongClassName" for each one.



Consider applying for YC's Summer 2026 batch! Applications are open till May 4

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

Search: