文章 评论 浏览 29
综合上面各位大佬的答案,使用立即执行函数如果没有return值的话相当于
setTimeout(undefined, Math.floor(Math.random() * 1000));
浏览器会报错,所以还是需要加入返回值的
setTimeout( (() => { console.log(n); return ()=>{}; })(), Math.floor(Math.random() * 1000));
文章 0 评论 0
接受
综合上面各位大佬的答案,使用立即执行函数如果没有return值的话相当于
浏览器会报错,所以还是需要加入返回值的
第 101 题:修改以下 print 函数,使之输出 0 到 99,或者 99 到 0