Answer the question
In order to leave comments, you need to log in
Why doesn't prototype see the variable from the constructor?
learn.javascript.ru/play/HviXUb Clicking
on the block should display Hello World, but world = undefiend. If you just call this.hello () in the constructor, then everything works
---
while I'm considering such a solution from the options, but maybe it's possible somehow else?
...
var that = this;
...
this.div.on('click', function(){
that.hello()
})
...
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question