JSFiddle - React, Tailwind, and code Playground
by gion_13
JavaScript
var Obj = {
//other code
clearLayer : function () {
console.log("it's me, the object!");
},
colonize : function (angle) {
this.clearLayer();
this.colonizingTimer = setTimeout(this.colonize, angle + 5);
if (angle < 10) {
this.colonizing = false;
this.state = 1;
}
else {
clearTimeout(this.colonizingTimer);
this.clearLayer();
}
}
};
window.clearLayer = function(){console.log("It's me, the WINDOW");};
Obj.colonize(0);