2024-08-27 09:23:22 +08:00

14 lines
332 B
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

//1. 完成下面的函数
/**
* 延迟一段指定的时间
* @param {Number} duration 等待的时间
* @returns {Promise} 返回一个任务,该任务在指定的时间后完成
*/
function delay(duration) {}
// 2. 按照要求调用delay函数完成程序
// 利用delay函数等待1秒钟输出finish