2 ms·
The underlying data structure of Space is an associate array, like in PHP. So Space objects are both hash tables and arrays. For example say you had a variable
by breck 14y ago
The underlying data structure of Space is an associate array, like in PHP.
So Space objects are both hash tables and arrays. For example say you had a variable named account with the space value:
charges
coffee $2.12
soda $1.21
cupcake $2.50
You could access the individual elements of this object like you would a hash table:
account.get('charges soda')
// Returns $1.21
Or like an array:
account.get('charges').get(1)
// Returns $1.21