JSFiddle - React, Tailwind, and code Playground
by amir_ch
JavaScript
function Constructor() {
this.foo = 'bar';
var self = this;
this.timerId = window.setTimeout(function() {
alert(self.foo);
}, 1000);
}
new Constructor();
by amir_ch
function Constructor() {
this.foo = 'bar';
var self = this;
this.timerId = window.setTimeout(function() {
alert(self.foo);
}, 1000);
}
new Constructor();