Problem in the tests of a challenge

In the “intermediate Algorithm Scripting” section of the javascript course, challenge “Drop it”.
Some of the tests(the second and the last tests) are not logical, you can see by reading the condition in the function func, that the results expected are not all right( some array elements expected in the result provided don’t pass the condition of the function func yet they are expected to be in the result by the creator of this challenge).

I’m stuck their, can somebody fix it?

Can you explain in more detail why you don’t think those tests are logical?

I’ll point you to this part of the instructions:

“…remove each element starting from the first element (the 0 index) until the function func returns true…”

1 Like

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

This is one of the tests, do you think element 2 passes the condition?

If the condition is n>2, element 2 should not be in the result array.

Read this again, very very slowly.

The challenge is not to replicate the behavior of filter.

1 Like

So basicly when the func returns true, return the rest of the array despite the fact that some of the elements in the rest of the array don’t pass the condition.
Thank you.

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.