Advertisement
ilianrusev

Untitled

Feb 18th, 2022
12
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function getArticleGenerator(articles) {
  2. const output = document.getElementById("content")
  3. const ourCopy = articles.slice()
  4.  
  5. return function showNext(arr = []) {
  6. if (ourCopy[0] !== undefined) {
  7. const article = document.createElement("article")
  8. article.innerHTML = ourCopy.shift()
  9. output.appendChild(article)
  10. }
  11.  
  12. return showNext
  13. }
  14. }
Advertisement
RAW Paste Data Copied
Advertisement