Question: So I know what the `apply()` function does in javascript, but if you were to implement it on your own, how would you do that? Preferably don't use bind, since that's pretty dependent on apply.

NOTE: I'm asking out of curiosity, I don't want to actually do this.

Answer: 
You're basically asking how to apply different transformations to an array depending on the index of the specific item. With Ruby you can chain `with_index` onto enumerators and then use the index inside your enumerator block as you loop through each array item. In order to transform an array into a new one, you will need to use `map`.

```
transformed_tests = tests.map.with_index do |test, index|
  if index.even?
    test.upcase
  else
    test.downcase
  end
end

```

or, a more compact version:

```
transformed_tests = tests.map.with_index do |test, index|
  test.send(index.even? ? :upcase : :downcase)
end

```

If you want to make the transform whilst collecting the input:

```
tests = 5.times.map do |index|
  input = gets.chomp
  input.send index.even? ? :upcase : :downcase
end

```
You want a simple way?

```
n = 5

test = []
(n/2).times.with_object([]) do
  test << gets.chomp.upcase
  test << gets.chomp
end
test << gets.chomp.upcase if n.even?

```

More Rubylike:

```
n.times.with_object([]) do |i,test| 
  str = gets.chomp
  str.upcase! if i.odd?
  test << str
end

```