Checks if value is in collection. If collection is a string, it's checked for a substring of value. If fromIndex is negative, it's used as the offset from the end of collection.
Contribution to minified bundle size, when it is the only function imported:
Lodash: 5,533 bytes
Micro-dash: 344 bytes
Type Parameters
T extends string | object | readonly any[]
Parameters
collection: T
value: T extends readonly any[] ? T[0] : T extends string ? string : T[keyof T]
Checks if
value
is incollection
. Ifcollection
is a string, it's checked for a substring ofvalue
. IffromIndex
is negative, it's used as the offset from the end ofcollection
.Contribution to minified bundle size, when it is the only function imported: