Question: I'm looking over someone's codes and wondering about the difference between: 

```
def blah
  @hello ||= [1,2,3].collect{|x| x+1}
end

```

and

```
def blah 
  @hello = [1,2,3].collect{|x| x+1}
end

```

I understand that `||=` means "or equal", but why do we need it? An example would be great.

Also, for the `collect` method, let's say I have an array:

```
a = [1,2,4,5]

```

and I wanted to find the array that contains integers that are greater than `2`, how can I use `collect` with that?

```
a.collect{|x| x>2} # => [false, false, true, true]

```

I want `[4,5]`.

Answer: 
> 
> a = [1,2,4,5] and I wanted to find the array that contains integers that are greater than 2,
> 
> 
> 

Here we go using [`Array#select`](http://www.ruby-doc.org/core-2.1.0/Array.html#method-i-select):

```
 a.select{|e| e > 2 } # => [4,5]

```

Explanation of the part `@hello ||= [1,2,3].collect{|x| x+1}` can be found [What does ||= (or equals) mean in Ruby?](https://stackoverflow.com/questions/995593/what-does-or-equals-mean-in-ruby)
Ok, so ||= means if you already have a previous value for your variable it will keep it
else, if it doesn't have any pre-assigned value, then it will take whatever value you set it equal to. 

EX: 

```
@hello = [1]

def blah
  @hello ||=[1,2,3]
end

blah 

@hello => [1], not [1,2,3]

```