Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function getArticleGenerator(articles) {
- const container = document.querySelector('#content');
- const setArticle = () => {
- if (articles.length > 0) {
- const articleElement = document.createElement('article');
- articleElement.appendChild(document.createTextNode(articles.shift()));
- container.appendChild(articleElement);
- }
- };
- return setArticle;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement