length (Function)

Signature: length(s: string | List<T> | Map<string, V>) -> int

Description: Returns a string's byte length or a List/Map element count.

Parameters

  • s (string | List | Map<string, V>): The string, List, or Map to measure

Returns: int

Example

let len = length("hello")  // 5
len = length "hello"  // 5