The usage of unref() and ref() is very simple, which is to cancel and reply to setTimeout and setInterval function.
The code is as follows:
var testFunction=function(){
console.log("guoyansi");
}
var timer=setInterval(testFunction,1000);
timer.unref();//Cancel the setTimeout and setInterval function with
timer.ref();//Restore the setTimeout and setInterval function with
Is not super simple, if you do not understand, please let go of javascript ~