Skip to content

Instantly share code, notes, and snippets.

@Zenahr
Last active July 12, 2020 21:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Zenahr/b2b910478692a234057756c9f41ba5c4 to your computer and use it in GitHub Desktop.
Save Zenahr/b2b910478692a234057756c9f41ba5c4 to your computer and use it in GitHub Desktop.
Get elements from array and put into dom using array.map() callback
function arrayToDom(inputArray, selectorID) {
            document.getElementById(selectorID).innerHTML = '<ul>' + inputArray[count].map((item) => {
                return '<li>' + item + '</li>';
            }).join('') + '</ul>';
        }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment