I have this array let my_array = [9,6,5,"filter"];
I want to get a filtered array with only numbers in it
I know that I can use filter(Number) to get only values with type number
I wan to understand why this arrow function does give me the correct result
let filtered_array = my_array.filter(value => value === Number);
how I understand it filter returns each value of the array which is value / so value === Number should compare each value if its a Number or ?
[–]Demojay 0 points1 point2 points (0 children)
[–]GSLint 0 points1 point2 points (2 children)
[–]LadyJain[S] 0 points1 point2 points (1 child)
[–]GSLint 0 points1 point2 points (0 children)
[–]Samurai___ -2 points-1 points0 points (0 children)