Answers for "javascript accessing this in callback"

0

javascript accessing this in callback

function MyConstructor(data, transport) {
    this.data = data;
    var self = this;
    transport.on('data', function() {
        alert(self.data);
    });
}
Posted by: Guest on June-04-2021

Code answers related to "javascript accessing this in callback"

Code answers related to "Javascript"

Browse Popular Code Answers by Language