The same functionality appears in different programming languages under different names. Here’s an attempt at gathering some interesting distinctions.
Plain old filter:
filter
(what is the opposite though?)select
+ reject
(Smalltalk, Ruby)partition
(combines both; Ruby, Rust)Filter, mutates original:
keep_if
, delete_if
(Ruby)Filter until predicate fails:
drop_while
, take_while
(Ruby)skip_while
, take_while
(Rust)find
(Ruby, Rust)detect
(Smalltalk)This applies a map to the elements of an array.
map
collect
(Smalltalk, Ruby)transform
(Ruby, e.g. transform_keys
and transform_values
)Equality is a can of worms.
=
==
===
====
eql?(other)
isEqual(other)
equals
equal?
include?
includes?
contain?
contains?
count
size
length