Okay, so I'm trying to remove elements from a number array that match a certain number. I got the correct solution already but I don't entirely understand it.
Here is the code that doesn't work:
And here is the console output: Console output
It works fine until two numbers beside each other are the same. Note how the ending result of the console output was [3,3]. Even though both of those 3's should have been removed. I read an article discussing the .splice() function. Article
I had trouble understanding what it meant, but the solution it provided was correct. I'm just trying to wrap my head around what goes no when the proceeding number in the array is the same as the current number.
Here is the solution that works: Working solution