I want to stop the execution of my code by 2 seconds so that all the on going animation can get finished. I am trying to call a function using setTimeout in Node.js
what I am doing in my code :
this.userActivity = function(a,b,side){
//some code of mine
setTimeout(this.doTheMagicIfPossible(this.scoringPossible),2000);
}
this. doTheMagicIfPossible = function(passedValue){
console.log("printing it out after 2 seconds"+passedValue);
}
But, execution is not getting stopped for 2 seconds.
If I do like this:
setTimeout(this.doTheMagicIfPossible,2000,this.scoringPossible);
Execution is getting stopped by 2 seconds but function is not getting this.scoringPossible, it's undefined in this case.