FrontendChallenges is a collection of frontend interview questions and answers. It is designed to help you prepare for frontend interviews. It's free and open source.
export function arrayFilter(array, callback) {
const filtered = [];
for (let i = 0; i < array.length; i++) {
const current = array[i];
if (callback(current, i, array)) {
filtered.push(current);
}
}
return filtered;
}
index.js