@ndhoule/includes

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

includes

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.

HomePage

https://github.com/ndhoule/includes

Repository

https://github.com/ndhoule/includes.git


上一篇:@ndhoule/keys
下一篇:@ndhoule/foldl

相关推荐

  • string-includes-x

    Determines whether one string may be found within another string. stringin...

    9 个月前
  • readme-includes

    Snippets for your GitHub project's readme. readmeincludes NPM version(https://badge.fury.io/js/rea...

    1 个月前
  • lodash.includes

    The lodash method exported as a module. lodash.includes v4.3.0 The lodash(https://lodash.com/) m...

    2 年前
  • lodash._arrayincludeswith

    The internal lodash function exported as a module. lodash.arrayincludeswith v4.0.0 The internal ...

    1 年前
  • lodash._arrayincludes

    The internal lodash function exported as a module. lodash.arrayincludes v4.0.0 The internal loda...

    1 年前
  • indexOf和includes方法的原理与实现

    1.indexOf的用法 indexOf() 方法可返回数组中某个指定的元素位置。该方法将从头到尾地检索数组,看它是否含有对应的元素。开始检索的位置在数组 start 处或数组的开头(没有指定 sta...

    2 个月前
  • ie does not support 'includes' method

    ie does not support 'includes' method...

    2 年前
  • grunt-includes

    Include other files within a file. gruntincludes Build Status(https://travisci.org/vanetix/gruntin...

    10 个月前
  • express-includes

    Express middleware for easily including stylesheets and javascript expressincludes Build Status(h...

    1 年前
  • eslint-plugin-prefer-includes

    prefer .includes over .contains and .indexOf eslintpluginpreferincludes https://github.com/sindre...

    23 天前

官方社区

扫码加入 JavaScript 社区