Object.len
Object.len
Function
Returns the number of key-value pairs of the object itself.
Syntax
object.len()
Parameters
No parameters.
Return value
| Type | Description |
|---|---|
| Int | Returns the number of object properties. |
Example
user = {name: 'BT', age: 1} result = user.len() // Output: 2 print result
Notes
- Only count the key values in the current object.