@ndhoule/includes

2020-01-13

@ndhoule/includes

Determine whether or not a value is contained by a given collection.

ci">includes CI

Determine whether or not a value is contained by a given collection.

Uses SameValueZero(the algorithm used by Object.is) for equality comparisons.

Installation

$ component install ndhoule/includes
$ npm install @ndhoule/includes

API

includes(searchElement : *, collection : Object|Array|string) => boolean

includes(2, [1, 2, 3]);
//=> true

includes(4, [1, 2, 3]);
//=> false

includes(2, { a: 1, b: 2, c: 3 });
//=> true

includes('a', { a: 1, b: 2, c: 3 });
//=> false

includes('abc', 'xyzabc opq');
//=> true

includes('nope', 'xyzabc opq');
//=> false

License

Released under the MIT license.

以上是 @ndhoule/includes 的使用教程帮助文档。


上一篇:@ndhoule/keys
下一篇:@ndhoule/foldl
相关教程
关注微信

扫码加入 JavaScript 社区

相关文章
暂无相关文章

首次访问,需要验证
微信扫码,关注即可
(仅需验证一次)

欢迎加入 JavaScript 社区

号内回复关键字:

回到顶部