First of all, let's take a look at the documentation:
The context is optional - it is only needed if the function f is an "extract" method.
In JavaScript functions calls and method calls are slightly different.
A method call such as obj.f(arg1) will
- evaluate obj
- extract the method f
- set `this` to the result of evaluating obj
- invoke the body of the method f with argument arg1.
The body of f can thus use `this` to refer to its object.
But what if we first extract an method and then call it, like this:
var g = obj.f
g(arg1)
The problem is now that the call g(arg1) is a function call instead of a method call.
Therefore `this` is not set to object obj before invoking the body of g.
Instead `this` will refer to a global object.
Back to Newton. If the function f is a standard function (which implies
there are no references to this in its body), then context is not supplied.
If the function f is an extracted method, then Newton needs to know
the object it was extracted from in order to set `this` before invoking
the body of f.
See more on `this` here:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/this--