What happens when we use classList.toggle() to toggle the class of an element?

If the element already has the class it's removed, otherwise it's addedThe class will be added to the elementIf the element has multiple classes, they will all be replaced

If the element already has the class it's removed, otherwise it's added.