const fetchNames = async () => {
try {
const res = await Promise.all([
axios.get("./names.json"),
axios.get("./names-mid.json"),
axios.get("./names-old.json")
]);
const data = res.map((res) => res.data);
console.log(data.flat());
} catch {
throw Error("Promise failed");
}
};