Hashes

suggest change

Introduction

A hash is a dictionary-like collection of unique keys and their values. It is sometimes called an associative array. An array is indexed by integers; a hash is indexed by any object. Look up or store an entry by its key.

Syntax

Remarks

Hashes in Ruby map keys to values using a hash table.

Any object can be a key. Keys that compare equal must return the same hash value. Symbols are common because each name is one interned object.

{ key1: "foo", key2: "baz"  }

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents