// Avec .then() function getUserPosts(userId) { return fetchUser(userId) .then(user => fetchPosts(user.id)) .then(posts => { console.log(posts); return posts; }); } // Avec async/await (plus lisible) async function getUserPosts(userId) { const user = await fetchUser(userId); const posts = await fetchPosts(user.id); console.log(posts); return posts; }