Prototype: sequence(tasks) accepts functions that may return values or promises. Invoke and await them one at a time in input order. Return results in that order. Stop at the first failure and propagate the exact error; do not start later tasks.

Final: allSettledOrdered(tasks) starts every task without waiting for earlier tasks. Return a promise for input-ordered records {status:"fulfilled", value} or {status:"rejected", reason}. Treat synchronous throws as rejections and preserve each reason's identity. Empty input returns an empty array. Input arrays remain unchanged.

Complete the exported stubs in exercise.mjs. The prototype and final stages have separate checks.

Shell
node main.mjs --stage prototype
node main.mjs --stage final

Use Node.js 20+ locally, or the website's browser worker. Tests are standard-library only and check the documented behavior; they do not prove performance or force garbage collection.

Drag or use the arrow keys to resize. Home collapses the question; End collapses the editor. Enter or double-click resets the split.
Loading editor…
No results yet.

Complete the starter code, then run the checks.
Results and errors will appear here.