Get the length of a String or Number, or the number of items in an Array.
Syntax
Parameters
false
(default) - Only items in the immediate Array will be counted.true
- The Array will be counted recursively, i.e. sub-Arrays will be counted too.
Result
subject
, or how many items it contains.
Returns the length of subject
. If subject
is a String, the length of the String will be returned. Numbers will be treated as Strings, and Booleans return their numeric equivalent. If subject
is an Array, the number of items it contains will be returned.