Q:

javascript getposts getcomments

    const run = document.getElementById("run");

    run.addEventListener("click", () => {
        lib.getPosts(callbackPost);

        function callbackPost(err, articles) {
            articles.forEach((art) => {
                lib.getComments(art.id, callbackComm);

                function callbackComm(err, comms) {
                    comms = art.comments;
                    console.log(art);
                }
            });
        }
    })
1

New to Communities?

Join the community