📜  如何在javascript代码示例中无限运行函数

📅  最后修改于: 2022-03-11 15:04:24.394000             🧑  作者: Mango

代码示例1
function loopFunction(delay, callback){
    var loop = function(){
        callback();
        setTimeout(loop, delay);
    }; loop();
};

loopFunction(1000, function(){console.log('Hello World!')});