title: How to add/remove objects from array with a button toggle?
body: <p>I wrote the following which adds items to an array and I made it so that we cannot add a duplicate object into it, however what I'd like to achieve is to actually add/remove if we click again on an added item:</p>
  
  <pre><code>  var countryArray = [];
    var countryName = " ";
    $("#africa, #europe, #asia, #america").on("click", function() {
      countryName = $(this).attr("id");
      countryArray.push(countryName);
      $("span").attr("data-country", $.unique(countryArray.sort()));
    });
  </code></pre>