1. Home
  2. Computing & Technology
  3. Ruby

Index Operator

By , About.com Guide

Definition:

Index Operator - An operator used to retrieve individual elements from a collection of elements, such as a hash or array. In Ruby, the index operator usually takes the form of square brackets following a variable names. When used with arrays, the operand (which is placed inside the square brackets) is the position of the desired element in the array. When used with hashes, the operand is the key associated with the desired value.

Explore Ruby
About.com Special Features

Holiday Central

What to eat, where to go, fun things to do and how to save money on the perfect gifts. More >

Family Tech Center

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

  1. Home
  2. Computing & Technology
  3. Ruby
  4. Glossary
  5. G - L
  6. Index Operator

©2009 About.com, a part of The New York Times Company.

All rights reserved.