* Write a function named protectPlants:
* Takes a parameter "thisPlot"
* Uses a while loop
* * for each plot while there are still bugs remaining
* * call the spray function
* !REMEMBER to stop at the final plot
*
* Call your protectPlants function with a starting plot value
*/
const plots = document.querySelectorAll(".plot")
function spray(thisPlot){
plots[thisPlot].classList.add("sprayed")
plots[thisPlot].innerHTML = ""
}
/* Challenge: Using while and do...while loops
*
* You need to spray the plots to remove the bugs
* Create a variable to hold the number of bugs