Lasso Soft Inc. > Home

[ map->values ]

Method

The [map->values] method returns an array of values from the map. This method is useful if the values of a map need to be inspected without their associated keys. If the map contains no values then an empty array is returned.

Note: The array object returned by [map->values] has type staticarray.

  • Syntax
Map->Values
Examples
  • Beginner

To display the names of all the values in a map:

Use the [map->values] method. This method returns an array that contains the values of all the keys in the map. The values are ordered in the order they are stored in the map, not in the order they were added to the map.

Code

var (colours = map( 'red'='#ff0000',
                     'green' = '#00ff00',
                     'blue' = '#0000ff',
                     'grey' = '#aaaaaa') )

$colours->values

Result

staticarray(#0000ff, #00ff00, #aaaaaa, #ff0000)

Recent Comments

No Comments found

Please note that periodically LassoSoft will go through the notes and may incorporate information from them into the documentation. Any submission here gives LassoSoft a non-exclusive license and will be made available in various formats to the Lasso community.

LassoSoft Inc. > Home

 

 

©LassoSoft Inc 2015 | Web Development by Treefrog Inc | PrivacyLegal terms and Shipping | Contact LassoSoft