Florian Groß
7/11/2007 9:02:00 PM
> For example, this works:
> irb> array[2]
> => [2, 2, 2, 2, 2, 2, 2, 2, 2, 2]
>
> But this doesn't seem to:
> irb> array[2[2]]
> => [2, 2, 2, 2, 2, 2, 2, 2, 2, 2]
>
> I'm pretty sure I'm just getting the syntax wrong.
Yup, you're calling [] on the number 2. You want array[2][2].