title: array.splice is not a function
body: <p>I am trying to remove an item from an array of unchecked with this bit of code.</p>
  
  <pre><code>function filterSearch() {
  var cats = [];
  
  $('.filter-by-type input[type="checkbox"]').change(function() {
    var cat = $(this).attr('name') + ', ';
     if(this.checked) {
        cats += cat;
     } else {
        cats.splice(cats.indexOf(cat), 1);
     }
  
    console.log(cats);
   });
  
  }
  
  filterSearch();
  </code></pre>
  
  <p>I am getting the error <code>Uncaught TypeError: cats.splice is not a function</code></p>
  
  <p>Basically I want to add the value to the <code>cats[]</code> array if the item is checked and removed if unchecked. Any help would be appreciated. </p>