Hacker Newsnew | past | comments | ask | show | jobs | submit | smilekzs's favoriteslogin

Using a library like Bluebird couldn't you simply write and get the exact behavior intended?

    async function renderChapters(urls) {
        Promise.map(urls, getJSON).each(j => j.html));
    }
or

    async function renderChapters(urls) {
        var chapters = await Promise.map(urls, getJSON);
        chapters.forEach(j => j.html);
    }

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: