This challenge has a bug in it.
This should work:
const dropElements = (arr, func) => {
get_remaining_elements = false;
return arr.reduce((a, b) => {
get_remaining_elements = get_remaining_elements ? true : func(b);
return get_remaining_elements ? [...a, b] : a;
}, []);
}
But I get:
Which is clearly wrong.