[Solved] Using a Javascript switch statement, how can I count the number of elements (numbers only) in an array? [closed]


Edit: Okay! A switch! Let’s do it!

var count = 0;
for(var i = number.length; i--;){
    switch(true){
        case typeof number[i] == 'number':
            count++;
    }
}
alert(count);

8

solved Using a Javascript switch statement, how can I count the number of elements (numbers only) in an array? [closed]