javascript getposts getcomments code example
Example: 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);
}
});
}
})