I am looking for anyone who can help me understand Js functions better.
And to help me with a project I am working on.
The project is a grocery list.
The person inputs an item and either press enter or clicks add to list button.
The button next to that is to clear the text field.
The other button is to clear the objects that the person just put in but does not delete the two original objects that are on the list since the beginning.
I want to only use pure genius and I don’t want to use arrays or a Jquery.
here is my code pen:
The only part I am focusing on is the remove all function. For what I want it to do is to take the The third to last items removed from the list but only keeping the two original items “bread and milk”