# Array#filter is Array#collect, yes?

**URL:** <https://rubytalk.org/t/array-filter-is-array-collect-yes/6725>\
**Category:** ruby-talk\
**Created:** [6 July 2003 02:30 UTC](https://rubytalk.org/t/array-filter-is-array-collect-yes/6725 "2003-07-06T02:30:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Samuel\_Tesla](https://avatars.discourse-cdn.com/v4/letter/s/439d5e/32.png) [@Samuel\_Tesla](https://rubytalk.org/u/Samuel_Tesla)\
**Post date:** [6 July 2003 02:30 UTC](https://rubytalk.org/t/array-filter-is-array-collect-yes/6725/1 "2003-07-06T02:30:06Z")

</div>

I was looking at some code and came across somebody using  
Array#filter. I couldn’t find it in the pickaxe, and looking through  
the ChangeLog it looks like that was replace with Array#collect and  
Array#collect!, is that correct?

---

<div class="post-metadata">

**Author:** ![Yukihiro\_Matsumoto2](https://avatars.discourse-cdn.com/v4/letter/y/b9e5f3/32.png) [@Yukihiro\_Matsumoto2](https://rubytalk.org/u/Yukihiro_Matsumoto2)\
**Post date:** [6 July 2003 06:29 UTC](https://rubytalk.org/t/array-filter-is-array-collect-yes/6725/2 "2003-07-06T06:29:38Z")

</div>

Hi,

> **···**
>
> In message “Array#filter is Array#collect, yes?” on 03/07/06, Samuel Tesla [samuel@alieniloquent.com](mailto:samuel@alieniloquent.com) writes:
> 
> > I was looking at some code and came across somebody using  
> > Array#filter. I couldn’t find it in the pickaxe, and looking through  
> > the ChangeLog it looks like that was replace with Array#collect and  
> > Array#collect!, is that correct?
> 
> Yes, “filter” is replaced by “collect!” (and “map!”).
> 
> ```
> matz.
> 
> ```
