(numItems= 10)
| 1 | function addItems(numItems= 10) { |
| 2 | const container = document.querySelector(".container"); |
| 3 | const items = container.children; |
| 4 | const lastItem = items[items.length - 1]; |
| 5 | const lastNumber = parseInt(lastItem.innerHTML); |
| 6 | |
| 7 | for (let i = 1; i <= numItems; i++){ |
| 8 | const newDiv = document.createElement("div"); |
| 9 | const newNumber = lastNumber + i; |
| 10 | |
| 11 | newDiv.innerText = newNumber.toString(); |
| 12 | container.appendChild(newDiv); |
| 13 | newDiv.classList.add(`item${newNumber}`); |
| 14 | } |
| 15 | |
| 16 | magicGrid.positionItems(); |
| 17 | } |
| 18 | |
| 19 | function removeItems(numItems = 10) { |
| 20 | const container = document.querySelector(".container"); |
nothing calls this directly
no test coverage detected