Drop it - need some lead in this

Tell us what’s happening:
This thing does work in a strach pad app on my mobile, but it fails the test here. I know, recrusive function, but do I miss something or just bumped into a bug?

Your code so far

function dropElements(arr, func) {
  // Drop them elements.

if (arr.length == 0) {
  	return arr;
  } else if (func(arr[0])) {
  	return arr;
  } else {
  	arr.shift();
  	dropElements(arr, func);
  }

}

dropElements([1, 2, 3], function(n) {return n < 3; });

Your browser information:

Your Browser User Agent is: Mozilla/5.0 (Android 8.1.0; Mobile; rv:61.0) Gecko/61.0 Firefox/61.0.

Link to the challenge:
https://www.freecodecamp.org/challenges/drop-it

You are just missing a return before dropElements(arr, func); on line 10 :smiley:

2 Likes

THANX, it is time to go to bed. The app on my phone has a console only. :rofl::rofl: