Having problem to understand the problem [Drop it]

I’m on a problem is known as Drop it.

According to the test cases,

dropElements([0, 1, 0, 1], function(n) {return n === 1;}) 
should return [1, 0, 1]

dropElements([1, 2, 3, 9, 2], function(n) {return n > 2;}) 
should return [3, 9, 2]

Why it’s not [1,1] and [3,9] instead of [1,0,1] and [3,9,2] ?

it asks to find the first element that passes the test, and remove everything before it. The rest of the array stay the same

1 Like