Async & Promises
Deferred Promise Utility
easyJS SpecificJS / TS3 tests
Problem Statement
Implement a `defer()` function that returns an object containing an unresolved promise alongside its exposed `resolve` and `reject` functions (similar to `Promise.withResolvers()`).
Examples
Example 1:
const { promise, resolve, reject } = defer();
setTimeout(() => resolve('data'), 100);
await promise; // 'data'JavaScript & TypeScript starter code included
Run this as a live interviewPractice solo
3 test cases. No second person needed.