(numItems = 10)
| 17 | } |
| 18 | |
| 19 | function removeItems(numItems = 10) { |
| 20 | const container = document.querySelector(".container"); |
| 21 | const items = container.children; |
| 22 | const lastIndex = items.length - 1; |
| 23 | let stopIndex = lastIndex - numItems; |
| 24 | |
| 25 | if (stopIndex < 0) stopIndex = 0; |
| 26 | |
| 27 | for (let i = lastIndex; i > stopIndex; i--){ |
| 28 | items[i].remove(); |
| 29 | } |
| 30 | magicGrid.positionItems(); |
| 31 | } |
| 32 |
nothing calls this directly
no test coverage detected