The bind method of javascript seems not working as expected

Viewed 234

var obj = {
    say: function() {
        function _say() {
            console.log(this);
        }
        return _say.bind(obj);
    }()
};

obj.say();

the code result is log out the global or window, I want to know why the bind method doesn't bind 'this' to the obj object context?

2 Answers
Related