var my_object = {
my_function: function() { return this }.bind( this /* which refers to 'my_object' */ )
}
// i get the 'window object' instead of 'my_object' which does not make sense to me ,
// i know that the my_function is already bound to my_object and i
// know that i do not need to use bind() , i was only trying to understand
// what's wrong with binding my_function to the same object again
console.log( my_object.my_function() );
/* i remove bind() this time */
my_object.my_function = function() { return this };
console.log( my_object.my_function() ); //i get 'my_object' this time which is expected but i should have got the same results above
I have already explained the problem for you, just look at the comments in my code above, thanks in advance