When to use "toggle()" method instead of "add()" and "remove()" methods in Javascript
Introduction
According to MDN, the toggle() method removes an existing token from the list and returns false. If the token doesn't exist it's added and the function returns true.
In simpler terms, toggle allows you to alternate between two use cases ...
kodervine.hashnode.dev6 min read