this keyword in ES function refers to the object that invokes the function, e.g.
bar.staticMethod() that’s object
bar invoking function
staticMethod. This language feature is quite commonly seen in many languages, especially object oriented ones – Java has the exactly same keyword, Python has
self (though it’s made explicit at method definition).
To answer your question,
bar.staticMethod IS referring the same thing, it’s just the
this keyword inside the function refers to different things. If you want your
bar.staticMethod to behave the same, you should make it pure function in the first place to ensure that.