toggle

fun toggle(token: T, force: Boolean = definedExternally): Boolean(source)

The toggle() method of the DOMTokenList interface removes an existing token from the list and returns false.

MDN Reference