A helper function to check if an item is:
- in an array -> remove it from the array,
- not in the array -> add it to the array
import toggle from 'array-item-toggle';
toggle([1, 2, 3], 1)
// returns a new array = [2, 3];
toggle([2, 3], 1)
// returns a new array = [2, 3, 1];