I'm trying to access this
in the prototype constructor
(I think that's what it's called?).
SomethingUseful.prototype = {
constructor: SomethingUseful,
init: init,
someFunction: someFunction,
mouseDownHandler: mouseDownHander.bind(this)
}
But this
equals window
. So I tried doing bind(SomethingUseful)
, and when I this
in the mouseDownHandler
, the whole function logs out as plain text, so I can't use things that are in this
, in the actual mouseDownHandler
function.
What's the correct way to access this
of SomethingUseful
in the constructor
function (again, I probably got the name wrong, and if I did, please correct it, or let me know in the comments)?