Question: I am creating an accumulator function for a practice problem that is supposed to filter odd elements in a numbers array. My code is passing
it should return an array it should return an array with the odd elements from the passed in array Error: expected [ 1 ] to deeply equal [ 1, 3, 5 ] it should return an array if there are no odd numbers it should return an array if given an empty array
JAVASCRIPT Function filteroddElements (numbers) \{ if(numbers. length ===0)\{ return []; if(numbers [i]%2==0){ return [];} var oddNumbers =[]; for (var i=0; i
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
