I know howe to do it using filter but I wondering if therei s a posibility to run this code with loop "for". Thank you for help.
function filter_list(l) {
let result = [];
for (i = 0; i < l.length; i++) {
if (typeof(l) === "number") {
return l[i];
}
}
}
console.log(filter_list(["abc", 1, 2, "def", 3, 4, "ghi"]));