instance method Enumerable#include

View source on GitHub →

Enumerable#include(object) → Boolean
  • object (?) – The object to look for.

Determines whether a given object is in the enumerable or not, based on the == comparison operator (equality with implicit type conversion).

Examples
$R(1, 15).include(10);
// -> true
 ['hello', 'world'].include('HELLO');
// -> false ('hello' != 'HELLO')
 [1, 2, '3', '4', '5'].include(3);
// -> true ('3' == 3)

Aliased as: Enumerable#member