title: Slick slider remove last slide if winWidth < 500
body: <p>Using <a href="http://kenwheeler.github.io/slick/" rel="nofollow">slick slide</a>, I'm trying to remove the last slide (slide 6) if the window width is less than 500.</p>
  
  <p>I have set up slick slider here -  <a href="https://jsfiddle.net/e14qpbqb/1/" rel="nofollow">JS Fiddle Slick Slider</a></p>
  
  <p>According to the documentation, the slideRemove function is the following Javascript</p>
  
  <pre><code>$('.add-remove').slick({
    slidesToShow: 3,
    slidesToScroll: 3
  });
  $('.js-add-slide').on('click', function() {
    slideIndex++;
  $('.add-remove').slick('slickAdd','&lt;div&gt;&lt;h3&gt;' + slideIndex + '&lt;/h3&gt;&lt;/div&gt;');
  });
  
  $('.js-remove-slide').on('click', function() {
  $('.add-remove').slick('slickRemove',slideIndex - 1);
   if (slideIndex !== 0){
   slideIndex--;
  }
  });
  </code></pre>
  
  <p>I need help with changing the <code>.on('click')</code> function from the docs to change at 500 winWidth.</p>