isNumber

val JsonElement.isNumber: Boolean

Returns true if this JsonElement is an unquoted numeric JsonPrimitive. Extension property on JsonElement.

A quoted numeric string such as "42" is a string, not a number, and JSON null is neither. The content must follow JSON number syntax or be NaN, Infinity or -Infinity, so every platform gives the same answer.