You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Challenge Drop it has an issue.
User Agent is: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.71 Safari/537.36.
Please describe how to reproduce this issue, and include links to screenshots if possible.
My code:
functiondropElements(arr,func){// Drop them elements.varduplicateArr=[];for(vari=0;i<arr.length;i++){if(func(arr[i])){duplicateArr.push(arr[i]);}}returnduplicateArr;}dropElements([1,2,3],function(n){returnn<3;});
Incorrect Test Cases
dropElements([0, 1, 0, 1], function(n) {return n === 1;}) should return [1, 0, 1] - actual return value [1, 1]
dropElements([1, 2, 3, 9, 2], function(n) {return n > 2;}) should return [3, 9, 2] - actual return value [3, 9]
The text was updated successfully, but these errors were encountered:
@pdhanoya You're to drop the items in the array, starting with index 0 until the function becomes true, NOT to drop all the items in the array that do not make the function (second argument) true. I see how it could be misunderstood.
@pdhanoya as @dhcodes has pointed out, the instructions say to drop elements until the function is true.
Drop the elements of an array (first argument), starting from the front, until the predicate (second argument) returns true.
Thus, the tests and instructions are consistent with each other. If you get stuck or have questions with a challenge in the future, please first ask questions to the Help Room. Happy coding!
Challenge Drop it has an issue.
User Agent is:
Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.71 Safari/537.36
.Please describe how to reproduce this issue, and include links to screenshots if possible.
My code:
Incorrect Test Cases
dropElements([0, 1, 0, 1], function(n) {return n === 1;}) should return [1, 0, 1] - actual return value [1, 1]
dropElements([1, 2, 3, 9, 2], function(n) {return n > 2;}) should return [3, 9, 2] - actual return value [3, 9]
The text was updated successfully, but these errors were encountered: