classList.toggle("active") is the cleanest toggle: add the class if absent, remove if present, and it returns the new state. Use it for accordions, theme switches, "read more", and active nav items — define both states in CSS and let one line of JS flip between them. Keep the visual logic in CSS, the trigger in JS.