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

I try to avoid OOP in my JavaScript code like the plague, I'd probably write it like this:

    function doSomething(obj){}

    var objs = [{},{},{}];
    objs.forEach(doSomething);
If I need late binding I'll use something like clojure's multi-methods. Both closures and prototypes aren't needed for this :)


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

Search: