If the item matching the condition already exists in the list it will be removed. If it does not it will be added.
toggle(list, item, toKey)
You can pass an optional toKey function to determine the identity of non-primitive values. Helpful when working with more complex data types.
toggle(list, item, toKey, options)
By default, toggle will append the item if it does not exist. If you need to prepend the item instead you can override the strategy in the options argument.