News for hackers. Stuff that matters.
Re:“This” in JavaScript by couchand on Tuesday December 09, 2014 @09:45AM (#8722950)
I don't think that's how bind works. Can you give a code example that shows unintuitive behavior? What I'm hearing from you is something like:

    function foo() {
        var bar = function() {
            console.log(this);
        };
        return bar.bind(42);
    }

    foo().call(1337); // prints 42
...which behaves as expected, so I'm not sure what you're getting at?

There are no comments on this comment yet.