Pardon the mess, Play My Code is in beta!

READY TO PLAY?
CLICK TO LOG IN!

sign up - lost password

Hash Class

The Hash is a collection for storing items. Items area stored against a key value, which can be used to retrieve them. It differs from the Array class, as it allows you to use any object for this key, rather then just whole numbers.

// create a new hash
myHash = { key : value, key2 : value }

// set value to a hash
myHash[ key ] = new Value()

// get value from a hash
myVal = myHash[ other_key ]

You can set and get values from the Hash using standard array notation.

new

each

keys

values

filter

contains

delete

clear

clone