JS is single-threaded, and multithreading can only be done for web workers. As far as I know.
However, if you have only a small script that you want to pause, you can have a global variable / flag and just in your script (I somehow assume that this is a function of a loop or event) there is a check for this flag. In this case:
var flag = false; ... if (flag) { do your code } else { do nothing or return if in function }
As soon as you want to continue, just set flag = true;
source share