fruitsButton.addEventListener("click", function () {
fruitsArray.forEach((fruit) => {
newParagraph.innerText = `I'll buy a ${fruit} next year `;
screenToShow.append(newParagraph);
});
});
I want my code to loop each individual element and show the text but when i try doing it keeps showing just the last element of the array, i tried to using the console and it works but on DOM it does not really work so pls help