<ul id="app">
<li>HTML</li>
</ul>
<script>
let app = document.querySelector('#app');
let langs = ['CSS','JavaScript','TypeScript'];
let nodes = langs.map(lang => {
let li = document.createElement('li');
li.textContent = lang;
return li;
});
app.prepend(...nodes);
</script>
//Newest method - only works in Opera, Chrome and Firefox
let parent; //Some DOM Element
let newChild; //Element wanting to append start of parent
parent.prepend(newChild); //Places newChild at start of parent.
//Alternatively, this can be used to add it to the end:
parent.append(newChild);
// parent.appendChild(newChild) can also be used, but you may only append one node, and
// no strings. However, it does return the element being appended.