I'm trying to write a function (onlyOddNumbers) that accepts an array of numbers and returns a new array with only the odd numbers, it's working but the problem is I'm getting strings in the new array instead of numbers, why this happen ?
let oddNumbersOnly=[]
const filter = function (numbers) {
for (number in numbers){
if(number %2 !==0){
oddNumbersOnly.push(number)
}
} return oddNumbersOnly;
};