Hello,
The following solution to this challenge passes all my local tests:
I get an error which seems not related to the code.
“Close alertSomething is not quite right. A report has been generated and the freeCodeCamp.org team have been notified”
“// running tests
TypeError: Cannot read property ‘message’ of undefined”
My code:
function dropElements(arr, func) {
let splicedArrayFromPositionWhereFunctionTrueFirstTime;
for (let index = 0; index < arr.length; index++) {
if (func(arr[index])) {
splicedArrayFromPositionWhereFunctionTrueFirstTime = arr.splice(index);
return splicedArrayFromPositionWhereFunctionTrueFirstTime;
}
}
return [];
}
dropElements([1, 2, 3], function (n) {
return n < 3;
});
module.exports = dropElements;