Don't think this is necessary, all you need here is `el.classList.remove( state );` -- the `remove` method will remove the class if it exists and simply do nothing if it doesn't.