if the array actually includes the value then it removes the value from the array if not then it adds the value to the array download this library: npm i toggle-item-in-array --save then import it: ...