A very happy way to live as a Javascript coder is to avoid the `this` keyword, in my experience. You really don't need it. Instead write this function as
(x, y) => Math.sqrt(x*x + y*y)
That can never have any state bugs, because it's a pure function (just like you can never have type errors with a sufficiently good type system).
And you might be interested in the native JS function (since ES6) called Math.hypot. Happy hacking :-)
And you might be interested in the native JS function (since ES6) called Math.hypot. Happy hacking :-)