Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the opposite of Array#reject in ruby?

Tags:

arrays

ruby

Is seems that it might be keep_if.

If so, why isn't it called keep?

like image 565
B Seven Avatar asked Oct 04 '12 02:10

B Seven


People also ask

What is the synonym of array?

arrangement, assembling, assemblage, line-up, formation, ordering, disposition, marshalling, muster, amassing. show, display, exhibition, presentation, exposition, spectacle. agglomeration, collection, aggregation, raft, range, variety, assortment, diversity, mixture, selection.

What is an opposite word?

Definitions of opposite word. a word that expresses a meaning opposed to the meaning of another word, in which case the two words are antonyms of each other.

What is opposite antonym?

Answer. An antonym is a word that is the opposite of another word. An opposite can be the other side of, reverse of, or something contrary to anything, not just words.


1 Answers

  • The opposite of reject is select (returning a new array)
  • The opposite of reject! is select! (editing the array in place)
  • The opposite of keep_if is delete_if (editing the array in place)
like image 58
pguardiario Avatar answered Sep 21 '22 09:09

pguardiario