title: How to remove values from array in random fashion using Angular JS?
body: <pre><code>var displayyears = [];
  $scope.Joinyear=function(display){
      $scope.yeardisplay=display; 
      if (displayyears.indexOf(display) == -1) {
          $scope.selected_class[display] = "selected";
          displayyears.push($scope.yeardisplay);
      }
      else{
          $scope.selected_class[display] = "";
          displayyears.splice($scope.displayyears.indexOf(display),1);
      }
  </code></pre>
  
  <p>It works but not in correct fashion.Suppose If i have array like this [2008,2009,2010,2011]. Now I remove value from array in random manner(in between like 2009) means it remove value 2008 only...How to remove value from array in random fashion using Angular JS</p>