DEV: refactor JS files to not use `self = this` in code. (PR #15095)

We no longer use this pattern. Instead, we can use bind(this) to the functions.

GitHub

I’m not sure about how to test this in the local dev environment :thinking:

You don’t need a bind(this) if you use the fat arrow (sel, callback) => syntax which we prefer.

The same => note from above should do it.