Async/await inside for…of vs. map
问题 I'm trying to figure out why promises seem to work differently inside of for...of vs. map() . data is an array of objects of the form {app: MY_APP, link: MY_LINK} . I'm trying to convert it to the form {app: MY_APP, status: true OR false}} . The function checkLink() is async because it uses node-fetch and basically returns whether the given link is 200. Using for...of , I get the desired object: let objToSend = []; for (obj of data) { objToSend.push({ app: obj.app, status: await checkLink(obj