The object module has functions for interacting with objects in Gago.
To create a new object, you run the object.create()
function. It has no paramaters and returns a blank object.
To set a value of a object in Gago, you use the object.set()
function. The syntax is as follows:
object.set(obj, key, value)
obj
objectkey
the key that will hold the value (string)value
any value you would like to assign to that key
This function returns a object
type.
To get a value, you use the object.get()
function. The syntax is as follows:
object.get(obj, key)
obj
objectkey
the key that you want to get the value of
This returns the value of that key-value pair or null
.
To get a array of all the keys, you use the object.keys()
function. Its only paramater is the object. It returns a object which contains strings (keys).