include :: Enumerable

include(object) -> Boolean

 

Determines whether a given object is in the Enumerable or not, based on the == comparison operator. Aliased as member.

 

Note this is not strict equality (===, comparing both value and type), but equivalence (just value, with implicit conversions).

 

If you need to check whether there is an element matching a given predicate, use any instead.

 

Examples

 

$R(1,15).include(10)

// -> true

 

['hello''world'].include('HELLO')

// -> false

 

[12'3''4''5'].include(3)

// -> true (== ignores actual type)

 

See also

 

Enumerable: any


Prototype API 1.5.0 - prototypejs.org