Attempting to eliminate the last two elements of an array and then append a 2 at the end, but encountering an error. The first test is successful but the second one fails.
var userArray = [4, 2, 8, 5, 0, 1, 6]; // Different array values might be used for tests
/* Your solution should be implemented here */
userArray.splice(5, 2, 2);
CORRECT: Checking the final value of userArray when the initial array is [4, 2, 8, 5, 0, 1, 6] Yours 4, 2, 8, 5, 0, 2
INCORRECT: Examining the final value of userArray when the initial array is [-5, 3] Yours and expected result do not match. Check highlights below. Yours -5, 3, 2 Expected 2