Continuing the discussion from freeCodeCamp Challenge Guide: Drop it:
Here is my solution using a Ternary Operator.
function dropElements(arr, func) {
return (arr.findIndex(func) === -1) ? [] : arr.slice(arr.findIndex(func));
};
If you see a wayy to improve my code please let me know.
I wanted to just add my solution to the āfreeCodeCamp Challenge Guide: Drop itā but could not figure out how to do that. Are you not able to add to that page anymore or am I just being stupid?