Is it possible to send interval id to executing function as an argument ? For example some thing like this:
var id= setInterval(myFunc.bind(null,id),1000);
What I am going to do is that in myFunc
I want to do some processing and clear interval if I need. I can't use global variable because it will be happened multiple time. And I know that I can use global array but it would a little a bit of time consuming because of my function logic. So I want to know if I can pass interval id as an argument to myFunc
.
EDIT: this stackOverfllow link dosen't help me because there were no helpful answer.