Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

xen::dictionary

Provides utilities for working with dictionaries. All of the available functions in this namespace are also available as member functions to dictionary objects.

include dictionary;

Public Functions

len

len (dict: dictionary) -> number

Returns the number of entries in the dictionary.

keys

keys (dict: dictionary) -> [string]

Returns all keys as a list.

values

values (dict: dictionary) -> [any]

Returns all values as a list.

has

has (dict: dictionary, value: any) -> bool

Returns whether the given dictionary contains an entry with the given value.

remove

remove (dict: dictionary, value: any) -> bool

Remove entry with given value from dictionary.

clear

clear (dict: dictionary) -> null

Empties the given dictionary, removing all items.