Data Formatter for Average on Client Side

I have a two dimensional array of data which is read from a server connect. So consider it a number of rows and columns like this:

'1'   'banana'    'green'   '7'
'3'   'pear'      'yellow'  null
'6'   'orange'    'purple'  '4'

I would like to find the average of the first column (1,3,6) and the last column (7,4) on the client side.

Is there an average function on the client side that I can use? Or do I need to do the maths myself with .sum() and .count()?

If the latter, can anyone remind me how to do a .where() where the condition is [not null]?

How do I handle the conversion from text to number for numbers?

Thanks!

Antony.

Community Page
Last updated: