If we want to automatically add or remove a class when we call the function, we can use the toggle() method.
toggle()
Run the code and press the button a few times to see it work.
Make sure to pick toggle.
toggle