Enumerable#contains()

contains (obj) Booleandeprecatedpublic

Defined in packages/ember-runtime/lib/mixins/enumerable.js:217

Use Enumerable#includes instead. See http://emberjs.com/deprecations/v2.x#toc_enumerable-contains

Returns true if the passed object can be found in the receiver. The default version will iterate through the enumerable until the object is found. You may want to override this with a more efficient version.

let arr = ['a', 'b', 'c'];

arr.contains('a'); // true
arr.contains('z'); // false

Parameters:

obj Object
The object to search for.

Returns:

Boolean
`true` if object is found in enumerable.
doc_EmberJs
2016-11-30 16:51:55
Comments
Leave a Comment

Please login to continue.