async function fetchMultipleData() {
try {
let [users, posts] = await Promise.all([
fetch('https://jsonplaceholder.typicode.com/users').then(res => res.json()),
fetch('https://jsonplaceholder.typicode.com/posts').then(res => res.json())
]);
console.log("Users:", users);
console.log("Posts:", posts);
} catch (error) {
console.error("Error fetching data:", error);
}
}
fetchMultipleData();