How can I count the number of elements in an array, because contrary to logic array.count(string) does not count all the elements in the array, it just searches for the number ...
not sure this was asked before, but I couldn't find an obvious answer. I'm trying to count the number of elements in a list that are equal to a certain value. ...
For instance, lets say we call the function countPositive([1,2,3]), it will return a 3. Or if we have the array, [-1,0,1], there is one positive, so the function will return 1. ...