.len

Description

Len is a bracketless method, that returns the length of its input value. It may conflict with object keys.

Parameters

Len takes no parameters

Usage On Arrays

arr = [1,2,3,4,5]

log arr.len
// returns 5

Usage On Strings

str = "12345"
// setup the string

log str.len
// returns 5

Usage On Objects

obj = {
  "1":"val",
  "2":"val"
}

log obj.len
// returns the number of keys in the object (2)

Last updated