So far we were iterating over array. But let's look how we can access certain element of array. You can access array by using _index_. Indexes can be tricky, but at the same time they're easy. It's the number of element minus one. In other words, if you're going to access firth element of array, you'll need `index` with the value of 4. Let's create array with five strings in REPL:
And when we know how to evaluate this expression, we can combine it with other methods, like:
```ruby
puts arr[4]
```
Or pass the result of expression to your own method as we could do it with variable:
```
my_own_method(arr[4])
```
We can also assign (replace) the value of particular _cell_ in array. For example:
```
# replace "two" with "whatever"
arr[1] = 'whatever'
```
Here is the demo of how it works:
{title="Replace value and iterate over array", lang=ruby, line-numbers=on}
```ruby
arr = %w(one two three four five)
arr[1] = 'whatever'
arr.each do |word|
puts word
end
```
Result:
```
one
whatever
three
four
five
```
We could also write this program another way (it's correct unless you have too many elements in your array so your program becomes too long to fit on a screen):
{title="Replace value and print array elements sequentially", lang=ruby, line-numbers=on}