SOURCE

// function strChange(title) {
//     let str = title.split('*');
//     str = str.map(item => item.toLowerCase());
//     return str.join('-');
// }
// const resultStr = strChange('HellO*Books*Sword*A*WoRld');
// console.log(resultStr);//返回'hello-books-sword-a-world'


function repeat(func, times, wait) {
    // let _times = times;
    return (v) => {
        let _timer = setInterval(() => {
            if (times <= 0) {
                clearInterval(_timer);
                return;
            }
            func(v);
            times--;
        }, wait);
    }
}
const repeatFun = repeat(console.log, 4, 1000);
repeatFun('zhengzhou');
console 命令行工具 X clear

                    
>
console