To recollect what others have said:
- in JS, you iterate over an array with
array.forEach which takes one argument - a function that will be called on all the elements of the array sequentially
- to append (add at the end) an element to the DOM (body of the page) you call
document.body.appendChild which takes the element to be added as an argument
Code you need then becomes
itemsAll.forEach(function (element, index, array) {
document.body.appendChild(element);
})
or (using ES6 syntax)
itemsAll.forEach(el => document.body.appendChild(el))