




Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
You can return a copy of a function with: function outerFunction(fn) { return function innerFunction(...params) { return fn(...params); }; }
Inside the inner function, you will need to return a new Promise.
You can create a new promise like: new Promise((resolve, reject) => {}).
You can execute code with a delay with "setTimeout(fn, delay)"
To reject a promise after a delay, "setTimeout(() => reject('err'), delay)"
You can resolve and reject when the passed promise resolves or rejects with: "fn(...params).then(resolve).catch(reject)"