|
---|
How Much is True? |
Create a function which returns the number of true values there are in an array. |
Examples |
<br>countTrue([true, false, false, true, false]) ➞ 2<br><br>countTrue([false, false, false, false]) ➞ 0<br><br>countTrue([]) ➞ 0<br> |
Notes |
- Return 0 if given an empty array. - All array items are of the type bool (true or false ). |