The util.JSONArray class / util.JSONArray methods |
Returns the type of a JSON array element.
util.JSONArray.getType( index INTEGER ) RETURNING type STRING
The getType() method returns the data type name corresponding to the JSON array element at the given position.
The index corresponding to the first element is 1.
This method can be used in conjunction with the getLength() method to read the entries of a JSON array object.
IMPORT util MAIN DEFINE arr util.JSONArray LET arr = util.JSONArray.parse('[123,"abc",null]') DISPLAY arr.getType(1) -- NUMBER DISPLAY arr.getType(2) -- STRING DISPLAY arr.getType(3) -- NULL END MAIN