Loading homepage
Implement arrayFilter to recreate the core behavior of Array.prototype.filter using a loop. Work with a standalone function that receives the array as its first argument.
Input: arrayFilter([1, 2, 3, 4], value => value % 2 === 0) Output: [2, 4]
Input: arrayFilter([1, 2], () => false) Output: []
arrayFilter(array, callback, thisArg?) — standalone equivalent for arrays.