I have an array that will have just a single non zero value along with the other 0 values at a time. For example, it may be
[0,0,0,0,0,0,0,1234,0,0,0]
// or
[0,0,2823,0,0,0,0,0,0,0,0]
//...
My question is, how may I get this non zero value from the array using javascript.
I know that I can iterate over the array and return the non zero value as soon as it is found but I was wondering if there is any functionality provided by javascript to do this?