Back
Syntax
Study
Editor
Mode:
HTML
CSS
JavaScript
PHP
Reset
Run »
HTML / CSS / JS
const [user, posts, comments] = await Promise.all([ fetch("/api/user").then(r => r.json()), fetch("/api/posts").then(r => r.json()), fetch("/api/comments").then(r => r.json()), ]); // Never fails — inspect each result const results = await Promise.allSettled([p1, p2, p3]); results.forEach(({ status, value, reason }) => { /* ... */ });
Result
Open