1var list = document.querySelector('#list')
2var fruits = ['Apple', 'Orange', 'Banana', 'Melon']
3
4var fragment = new DocumentFragment()
5
6fruits.forEach(function (fruit) {
7 var li = document.createElement('li')
8 li.innerHTML = fruit
9 fragment.appendChild(li)
10})
11
12list.appendChild(fragment)
13
1var displayArray = […]; // Lots of img elements
2var holder = $('#imgSection').hide();
3for (var i=0; i<displayArray.length; i++)
4 holder.append(displayArray[i]);
5holder.show();
6