Using lodash push to an array only if value doesn't exist?
<p>I'm trying to make an array that if a value doesn't exist then it is added but however if the value is there I would like to remove that value from the array as well. </p>

<p>Feels like Lodash should be able to do something like this. </p>

<p>I'm interested in your best practises suggestions. </p>

<p>Also it is worth pointing out that I am using Angular.js</p>

<p><strong>* Update *</strong> </p>

<pre><code>if (!_.includes(scope.index, val)) {
    scope.index.push(val);
} else {
  _.remove(scope.index, val);
}
</code></pre>