This is the code but it returns in unidentified . It should return two arrays where the first one is a set of odd numbers in the original array and the second is odd
function evenAndOdd(array) {
let odd = [];
let even = [];
for (i = 0; i < array.length; i++) {
if (array[i] % 2 === 0) {
even.push(array[i]);
} else {
odd.push(array[i]);
}
}
return even,odd;
}
return [even,odd];odd. JavaScript is not Python, and,is an operator. What you could return though is[even,odd], and then destructure it later.