How to start setInterval after object initialization?

后端 未结 0 371
抹茶落季
抹茶落季 2020-12-06 08:24
function Game() {
  this.number = 0;
  const t = setInterval(() => {
      this.number = Math.floor((Math.random() * 10) + 1);
      }, 1000);

  this.checkNumber         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题