3 ms·
I think that the article is actually correct, because the reason why in other - mostly static, and better designed dynamic -languages, you knew that member fun
by Sawamara 9y ago
I think that the article is actually correct, because the reason why in other - mostly static, and better designed dynamic -languages, you knew that member functions were bound to the object being called is because that is how the functions were actually handled by that language's runtime. There is no such assumption in JS, so where in C# you explicitly design a delegate, the reverse is true here. You need to explicitly bind the function or declare the function as a property with an arrow function and capture the execution context.