malinovsky,
"use strict"
class Game
{
constructor()
{
let self = this;
this.loop = function(time) {
console.log(time);
requestAnimationFrame(self.loop);
};
this.loop();
}
}
var game = new Game();
"use strict"
class Game
{
constructor()
{
this.loop = function(time) {
console.log(time);
requestAnimationFrame(this.loop);
}.bind(this);
this.loop();
}
}
var game = new Game();