one

This function returns a thing from a set. The set must contain at least one thing, otherwise a lookup_err() is raised.

The thing which is returned from the set is neither random nor predictable.

This function does not generate a change.

Function

set.one()

Arguments

None

Return value

One thing from the set or a lookup_err() when empty.

Example

This code shows an example using one():

// Returns either Iris, Cato or Tess
set({name: 'Iris'},
    {name: 'Cato'},
    {name: 'Tess'},
).one();

Example return value in JSON format

{
    "name": "Iris"
}