Click on the a function and call the b function in the an execution. The b function is an interval timer, so why not execute it regularly and only once?

when you click on the a function and call the b function in the an execution, the b function is an interval timer, so why not execute it regularly and only once?

            a(item,key){
            //....(
                    this.Time=setInterval(this.b(item,key),1000);
                    //   
                }
            },
           b(item,key){
           console.log(item);
           console.log(key);
           //
           }

clipboard.png

Why is the timer invalid?

Oct.13,2021

this.b (item,key) must return a method instead of executing it once

b(item,key){
  return function(){
    console.log(item);
    console.log(key);
  }
}
Menu