呼唤远方
上面提到的函数执行,不管它是否在以前的调用中完成,这个函数在执行完成后每x秒运行一次。// IIFE(function runForever(){
// Do something here
setTimeout(runForever, 5000)})()// Regular function with argumentsfunction someFunction(file, directory){
// Do something here
setTimeout(someFunction, 5000, file, directory)
// YES, setTimeout passes any extra args to
// function being called}