Array_.chunk_.compact_.concat_.difference_.differenceBy_.differenceWith_.drop_.dropRight_.dropRightWhile_.dropWhile_.fill_.findIndex_.findLastIndex_.flatten_.flattenDeep_.flattenDepth_.fromPairs_.head_.indexOf_.initial_.intersection_.intersectionBy_.intersectionWith_.join_.last_.lastIndexOf_.nth_.pull_.pullAll_.pullAllBy_.pullAllWithCollectionDateFunctionLang_.castArray_.clone_.cloneDeep_.cloneDeepWith_.cloneWith_.conformsTo_.eq_.gt_.gte_.isArguments_.isArray_.isArrayBuffer_.isArrayLike_.isArrayLikeObject_.isBoolean_.isBuffer_.isDate_.isElement_.isEmpty_.isEqual_.isEqualWith_.isError_.isFinite_.isFunction_.isInteger_.isLength_.isMap_.isMatch_.isMatchWith_.isNaN_.isNative_.isNil_.isNull_.isNumberMathObjectSeqString_.camelCase_.capitalize_.deburr_.endsWith_.escape_.escapeRegExp_.kebabCase_.lowerCase_.lowerFirst_.pad_.padEnd_.padStart(string ='',length = 0,chars ='')_.parseInt_.repeat(string ='',n = 1)_.replace(string ='',pattern,replacement)_.snakeCase_.split_.startCase_.startsWith_.template_.toLower_.toUpper_.trim_.trimEnd(string ='',chars = whitespace)_.trimStart_.truncate_.unescape_.upperCase_.upperFirstUtil_.attempt_.bindAll_.cond_.conforms_.constant_.defaultTo_.flow_.flowRight_.identity_.iteratee_.matches_.matchesProperty_.method_.methodOf_.mixin_.noConflict_.noop_.nthArg_.over_.overEvery_.overSome_.property_.propertyOf_.range_.rangeRight_.runInContext_.stubArray()_.stubFalse_.stubObject_.stubString_.stubTrue_.times_.toPath_.uniqueIdMethods检查值是否在集合中。 如果collection是一个字符串,则检查是否有值的子字符串,否则使用SameValueZero进行相等性比较。 如果fromIndex为负数,它将用作从收集结束的偏移量。
0.1.0
collection (Array | Object | string):要检查的集合。 value (*):要搜索的值。 [fromIndex=0] (数字):从中搜索的索引。 (boolean): 如果找到值,则返回true,否则返回false。
_.includes([1, 2, 3], 1);
// => true
_.includes([1, 2, 3], 1, 2);
// => false
_.includes({ 'a': 1, 'b': 2 }, 1);
// => true
_.includes('abcd', 'bc');
// => true