Trying to remove the last element from an array when a back button is clicked. Console is showing the correct elements in the array. it's looking like the array.slice function isn't working however I can't see why.
Code is:
$('#backButton .back').click(function(e) {
e.preventDefault();
answers.slice(0,-1);
console.log(answers);
});
Answers array is showing the correct result apart from the last element in the array isn't being removed. Thanks!