Your algorithm may pass most of the provided tests but there are two critical errors that makes your algorithm incorrect: 1) you are mutating the array while iterating on the same array, 2) you are returning the array as soon as the condition is met.

- you are mutating the array while iterating over the same array.

To see why this is problematic, keep track on variables affected by each iteration.

Iteration #1

```
arr.length = 4
i = 0
```

Iteration #2

```
arr.length = 3
i = 1
```

Iteration #3

```
arr.length = 2
i = 2
```

Based on your loop condition, iteration ends here and returns the array, [3, 4]

- you are returning the array as soon as the condition is met.

Consider following,

```
// Drop element that doesn't meet the requirement specified by callback function.
dropElements([3, 2, 1], function(n) {
return n > 2;
});
// Expects: [ 3 ]
// Yields: [3, 2, 1]
```

On first iteration, since 3 is greater than 2, the code flows to return statement in ‘else-if’ clause that will terminate the loop. Hence, your algorithm yields incorrect result, [3, 2, 1].

You should re-think about your approach.