1// *** JS GetPosts Callback ***
2
3 run.addEventListener('click', () => {
4 window.lib.getPosts((error, articles) => {
5 return (error ? console.log(error) : console.log(articles));
6 /* Alternate syntax
7 if (error) {
8 console.log(error);
9 }
10 for (elem of articles) {
11 console.log(elem);
12 }; // => console.log(articles); similarly works
13 /*
14 });
15 })