javascript getposts getcomments

Solutions on MaxInterview for javascript getposts getcomments by the best coders in the world

showing results for - "javascript getposts getcomments"
Catherine
26 Aug 2017
1    const run = document.getElementById("run");
2
3    run.addEventListener("click", () => {
4        lib.getPosts(callbackPost);
5
6        function callbackPost(err, articles) {
7            articles.forEach((art) => {
8                lib.getComments(art.id, callbackComm);
9
10                function callbackComm(err, comms) {
11                    comms = art.comments;
12                    console.log(art);
13                }
14            });
15        }
16    })