Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on Space: A whitespace alternative to JSON. Parent comment
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
account.get('charges soda') // Returns $1.21
account.get('charges').get(1) // Returns $1.21
There are no comments on this comment yet.
So Space objects are both hash tables and arrays. For example say you had a variable named account with the space value:
You could access the individual elements of this object like you would a hash table: Or like an array: