-
Notifications
You must be signed in to change notification settings - Fork 7
Map
It creates a new map.
Precondition : it requires the name of the map
Example : map create fruits
Note : The created map will be in the global scope. Under the hood it is an associative array.
It add an element to map.
Precondition : it requires the name of the map, the key and the element.
Example : map add fruits apple 2
Removes all elements from map.
Precondition : it requires the name of the map.
Example : map erase fruits
Returns the number of elements in the map.
Precondition : it requires the name of the map.
Example : map size fruits
Removes the mapping for a key from the map.
Precondition : it requires the name of the map and the key.
Example : map remove fruits apple
Returns the value to which the specified key is mapped.
Precondition : it requires the name of the map and the key.
Example : map get fruits apple
Sets a value to the specified key in the map.
Precondition : it requires the name of the map the key and the value.
Example : map set fruits apple 3
Return the keys contained in the map.
Precondition : it requires the name of the map.
Example : map keys fruits
Returns the values contained in the map.
Precondition : it requires the name of the map.
Example : map values fruits
Returns true if the map contains a mapping for the specified key otherwise returns false.
Precondition : it requires the name of the map ant the key.
Example : map contains fruits apple
Returns whether the map is empty.
Precondition : it requires the name of the map.
Example : map empty fruits
It destroys the map.
Precondition : it requires the name of the map.
Example : map destroy fruits