-
It's "just classic javascript
this
" :) It's not a because "the module code runs in its own scope".
At line 21, thethis
inside the callback function inside thesetInterval
is not what you would expect. Basically nothing / global scope, because you did not specify thethis
argument, or usedbind
. Just JS default behavior. :)
That's why code was littered withvar that = this
. But now it's kind-of sort-of solved in ES6 / typescript code.
It's the piece of code from the editor I upload to experiment with modules. Later on this will be put to the file system as one file (that's the plan).
Well it's referring to the beep function, that only has two argument. So it should work, right?
Thanks for the hint: creating a new reference for this worked, though I'm not sure why?
Is it because the module code runs in its own scope? And this is not referring to SOUND but rather to the main scope?