What is the difference between splice
and slice
?
$scope.participantForms.splice(index, 1);
$scope.participantForms.slice(index, 1);
Splice and Slice are built-in Javascript commands -- not specifically AngularJS commands. Slice returns array elements from the "start" up until just before the "end" specifiers. Splice mutates the actual array, and starts at the "start" and keeps the number of elements specified. Google has plenty of info on this, just search.