'Find a specific value in a multi-dimensional array list

Let suppose there is an array of cells each containing a specific set of valid characters. Valid characters are either "Null/No value", "*", "X", "0", "1". For simplicity sake, lets assume the array is 3 rows and 3 columns

Col1 Col2 Col 3
X NV 0
* 1 X
1 NV 1

Glist = [[X,,0],[*,1,X],[1,,1]] /*assuming this is the right method to represent the 3X3 from above

How do I use count() function of array to determine how many times a certain value exists in the array elements?

I tried Glist.count(1) and it returned a value of 0

Thanks in advance.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source