1 # <a href="https://lodash.com/">lodash</a> <span>v4.5.1</span>
3 <!-- div class="toc-container" -->
8 * <a href="#_chunkarray-size0">`_.chunk`</a>
9 * <a href="#_compactarray">`_.compact`</a>
10 * <a href="#_concatarray-values">`_.concat`</a>
11 * <a href="#_differencearray-values">`_.difference`</a>
12 * <a href="#_differencebyarray-values-iteratee_identity">`_.differenceBy`</a>
13 * <a href="#_differencewitharray-values-comparator">`_.differenceWith`</a>
14 * <a href="#_droparray-n1">`_.drop`</a>
15 * <a href="#_droprightarray-n1">`_.dropRight`</a>
16 * <a href="#_droprightwhilearray-predicate_identity">`_.dropRightWhile`</a>
17 * <a href="#_dropwhilearray-predicate_identity">`_.dropWhile`</a>
18 * <a href="#_fillarray-value-start0-endarraylength">`_.fill`</a>
19 * <a href="#_findindexarray-predicate_identity">`_.findIndex`</a>
20 * <a href="#_findlastindexarray-predicate_identity">`_.findLastIndex`</a>
21 * <a href="#_headarray" class="alias">`_.first` -> `head`</a>
22 * <a href="#_flattenarray">`_.flatten`</a>
23 * <a href="#_flattendeeparray">`_.flattenDeep`</a>
24 * <a href="#_flattendeptharray-depth1">`_.flattenDepth`</a>
25 * <a href="#_frompairspairs">`_.fromPairs`</a>
26 * <a href="#_headarray">`_.head`</a>
27 * <a href="#_indexofarray-value-fromindex0">`_.indexOf`</a>
28 * <a href="#_initialarray">`_.initial`</a>
29 * <a href="#_intersectionarrays">`_.intersection`</a>
30 * <a href="#_intersectionbyarrays-iteratee_identity">`_.intersectionBy`</a>
31 * <a href="#_intersectionwitharrays-comparator">`_.intersectionWith`</a>
32 * <a href="#_joinarray-separator-">`_.join`</a>
33 * <a href="#_lastarray">`_.last`</a>
34 * <a href="#_lastindexofarray-value-fromindexarraylength-1">`_.lastIndexOf`</a>
35 * <a href="#_pullarray-values">`_.pull`</a>
36 * <a href="#_pullallarray-values">`_.pullAll`</a>
37 * <a href="#_pullallbyarray-values-iteratee_identity">`_.pullAllBy`</a>
38 * <a href="#_pullatarray-indexes">`_.pullAt`</a>
39 * <a href="#_removearray-predicate_identity">`_.remove`</a>
40 * <a href="#_reverse">`_.reverse`</a>
41 * <a href="#_slicearray-start0-endarraylength">`_.slice`</a>
42 * <a href="#_sortedindexarray-value">`_.sortedIndex`</a>
43 * <a href="#_sortedindexbyarray-value-iteratee_identity">`_.sortedIndexBy`</a>
44 * <a href="#_sortedindexofarray-value">`_.sortedIndexOf`</a>
45 * <a href="#_sortedlastindexarray-value">`_.sortedLastIndex`</a>
46 * <a href="#_sortedlastindexbyarray-value-iteratee_identity">`_.sortedLastIndexBy`</a>
47 * <a href="#_sortedlastindexofarray-value">`_.sortedLastIndexOf`</a>
48 * <a href="#_sorteduniqarray">`_.sortedUniq`</a>
49 * <a href="#_sorteduniqbyarray-iteratee">`_.sortedUniqBy`</a>
50 * <a href="#_tailarray">`_.tail`</a>
51 * <a href="#_takearray-n1">`_.take`</a>
52 * <a href="#_takerightarray-n1">`_.takeRight`</a>
53 * <a href="#_takerightwhilearray-predicate_identity">`_.takeRightWhile`</a>
54 * <a href="#_takewhilearray-predicate_identity">`_.takeWhile`</a>
55 * <a href="#_unionarrays">`_.union`</a>
56 * <a href="#_unionbyarrays-iteratee_identity">`_.unionBy`</a>
57 * <a href="#_unionwitharrays-comparator">`_.unionWith`</a>
58 * <a href="#_uniqarray">`_.uniq`</a>
59 * <a href="#_uniqbyarray-iteratee_identity">`_.uniqBy`</a>
60 * <a href="#_uniqwitharray-comparator">`_.uniqWith`</a>
61 * <a href="#_unziparray">`_.unzip`</a>
62 * <a href="#_unzipwitharray-iteratee_identity">`_.unzipWith`</a>
63 * <a href="#_withoutarray-values">`_.without`</a>
64 * <a href="#_xorarrays">`_.xor`</a>
65 * <a href="#_xorbyarrays-iteratee_identity">`_.xorBy`</a>
66 * <a href="#_xorwitharrays-comparator">`_.xorWith`</a>
67 * <a href="#_ziparrays">`_.zip`</a>
68 * <a href="#_zipobjectprops-values">`_.zipObject`</a>
69 * <a href="#_zipobjectdeepprops-values">`_.zipObjectDeep`</a>
70 * <a href="#_zipwitharrays-iteratee_identity">`_.zipWith`</a>
77 * <a href="#_countbycollection-iteratee_identity">`_.countBy`</a>
78 * <a href="#_foreachcollection-iteratee_identity" class="alias">`_.each` -> `forEach`</a>
79 * <a href="#_foreachrightcollection-iteratee_identity" class="alias">`_.eachRight` -> `forEachRight`</a>
80 * <a href="#_everycollection-predicate_identity">`_.every`</a>
81 * <a href="#_filtercollection-predicate_identity">`_.filter`</a>
82 * <a href="#_findcollection-predicate_identity">`_.find`</a>
83 * <a href="#_findlastcollection-predicate_identity">`_.findLast`</a>
84 * <a href="#_flatmapcollection-iteratee_identity">`_.flatMap`</a>
85 * <a href="#_foreachcollection-iteratee_identity">`_.forEach`</a>
86 * <a href="#_foreachrightcollection-iteratee_identity">`_.forEachRight`</a>
87 * <a href="#_groupbycollection-iteratee_identity">`_.groupBy`</a>
88 * <a href="#_includescollection-value-fromindex0">`_.includes`</a>
89 * <a href="#_invokemapcollection-path-args">`_.invokeMap`</a>
90 * <a href="#_keybycollection-iteratee_identity">`_.keyBy`</a>
91 * <a href="#_mapcollection-iteratee_identity">`_.map`</a>
92 * <a href="#_orderbycollection-iteratees-_identity-orders">`_.orderBy`</a>
93 * <a href="#_partitioncollection-predicate_identity">`_.partition`</a>
94 * <a href="#_reducecollection-iteratee_identity-accumulator">`_.reduce`</a>
95 * <a href="#_reducerightcollection-iteratee_identity-accumulator">`_.reduceRight`</a>
96 * <a href="#_rejectcollection-predicate_identity">`_.reject`</a>
97 * <a href="#_samplecollection">`_.sample`</a>
98 * <a href="#_samplesizecollection-n0">`_.sampleSize`</a>
99 * <a href="#_shufflecollection">`_.shuffle`</a>
100 * <a href="#_sizecollection">`_.size`</a>
101 * <a href="#_somecollection-predicate_identity">`_.some`</a>
102 * <a href="#_sortbycollection-iteratees-_identity">`_.sortBy`</a>
109 * <a href="#_now">`_.now`</a>
116 * <a href="#_aftern-func">`_.after`</a>
117 * <a href="#_aryfunc-nfunclength">`_.ary`</a>
118 * <a href="#_beforen-func">`_.before`</a>
119 * <a href="#_bindfunc-thisarg-partials">`_.bind`</a>
120 * <a href="#_bindkeyobject-key-partials">`_.bindKey`</a>
121 * <a href="#_curryfunc-arityfunclength">`_.curry`</a>
122 * <a href="#_curryrightfunc-arityfunclength">`_.curryRight`</a>
123 * <a href="#_debouncefunc-wait0-options">`_.debounce`</a>
124 * <a href="#_deferfunc-args">`_.defer`</a>
125 * <a href="#_delayfunc-wait-args">`_.delay`</a>
126 * <a href="#_flipfunc">`_.flip`</a>
127 * <a href="#_memoizefunc-resolver">`_.memoize`</a>
128 * <a href="#_negatepredicate">`_.negate`</a>
129 * <a href="#_oncefunc">`_.once`</a>
130 * <a href="#_overargsfunc-transforms">`_.overArgs`</a>
131 * <a href="#_partialfunc-partials">`_.partial`</a>
132 * <a href="#_partialrightfunc-partials">`_.partialRight`</a>
133 * <a href="#_reargfunc-indexes">`_.rearg`</a>
134 * <a href="#_restfunc-startfunclength-1">`_.rest`</a>
135 * <a href="#_spreadfunc-start0">`_.spread`</a>
136 * <a href="#_throttlefunc-wait0-options">`_.throttle`</a>
137 * <a href="#_unaryfunc">`_.unary`</a>
138 * <a href="#_wrapvalue-wrapperidentity">`_.wrap`</a>
145 * <a href="#_castarrayvalue">`_.castArray`</a>
146 * <a href="#_clonevalue">`_.clone`</a>
147 * <a href="#_clonedeepvalue">`_.cloneDeep`</a>
148 * <a href="#_clonedeepwithvalue-customizer">`_.cloneDeepWith`</a>
149 * <a href="#_clonewithvalue-customizer">`_.cloneWith`</a>
150 * <a href="#_eqvalue-other">`_.eq`</a>
151 * <a href="#_gtvalue-other">`_.gt`</a>
152 * <a href="#_gtevalue-other">`_.gte`</a>
153 * <a href="#_isargumentsvalue">`_.isArguments`</a>
154 * <a href="#_isarrayvalue">`_.isArray`</a>
155 * <a href="#_isarraybuffervalue">`_.isArrayBuffer`</a>
156 * <a href="#_isarraylikevalue">`_.isArrayLike`</a>
157 * <a href="#_isarraylikeobjectvalue">`_.isArrayLikeObject`</a>
158 * <a href="#_isbooleanvalue">`_.isBoolean`</a>
159 * <a href="#_isbuffervalue">`_.isBuffer`</a>
160 * <a href="#_isdatevalue">`_.isDate`</a>
161 * <a href="#_iselementvalue">`_.isElement`</a>
162 * <a href="#_isemptyvalue">`_.isEmpty`</a>
163 * <a href="#_isequalvalue-other">`_.isEqual`</a>
164 * <a href="#_isequalwithvalue-other-customizer">`_.isEqualWith`</a>
165 * <a href="#_iserrorvalue">`_.isError`</a>
166 * <a href="#_isfinitevalue">`_.isFinite`</a>
167 * <a href="#_isfunctionvalue">`_.isFunction`</a>
168 * <a href="#_isintegervalue">`_.isInteger`</a>
169 * <a href="#_islengthvalue">`_.isLength`</a>
170 * <a href="#_ismapvalue">`_.isMap`</a>
171 * <a href="#_ismatchobject-source">`_.isMatch`</a>
172 * <a href="#_ismatchwithobject-source-customizer">`_.isMatchWith`</a>
173 * <a href="#_isnanvalue">`_.isNaN`</a>
174 * <a href="#_isnativevalue">`_.isNative`</a>
175 * <a href="#_isnilvalue">`_.isNil`</a>
176 * <a href="#_isnullvalue">`_.isNull`</a>
177 * <a href="#_isnumbervalue">`_.isNumber`</a>
178 * <a href="#_isobjectvalue">`_.isObject`</a>
179 * <a href="#_isobjectlikevalue">`_.isObjectLike`</a>
180 * <a href="#_isplainobjectvalue">`_.isPlainObject`</a>
181 * <a href="#_isregexpvalue">`_.isRegExp`</a>
182 * <a href="#_issafeintegervalue">`_.isSafeInteger`</a>
183 * <a href="#_issetvalue">`_.isSet`</a>
184 * <a href="#_isstringvalue">`_.isString`</a>
185 * <a href="#_issymbolvalue">`_.isSymbol`</a>
186 * <a href="#_istypedarrayvalue">`_.isTypedArray`</a>
187 * <a href="#_isundefinedvalue">`_.isUndefined`</a>
188 * <a href="#_isweakmapvalue">`_.isWeakMap`</a>
189 * <a href="#_isweaksetvalue">`_.isWeakSet`</a>
190 * <a href="#_ltvalue-other">`_.lt`</a>
191 * <a href="#_ltevalue-other">`_.lte`</a>
192 * <a href="#_toarrayvalue">`_.toArray`</a>
193 * <a href="#_tointegervalue">`_.toInteger`</a>
194 * <a href="#_tolengthvalue">`_.toLength`</a>
195 * <a href="#_tonumbervalue">`_.toNumber`</a>
196 * <a href="#_toplainobjectvalue">`_.toPlainObject`</a>
197 * <a href="#_tosafeintegervalue">`_.toSafeInteger`</a>
198 * <a href="#_tostringvalue">`_.toString`</a>
205 * <a href="#_addaugend-addend">`_.add`</a>
206 * <a href="#_ceilnumber-precision0">`_.ceil`</a>
207 * <a href="#_floornumber-precision0">`_.floor`</a>
208 * <a href="#_maxarray">`_.max`</a>
209 * <a href="#_maxbyarray-iteratee_identity">`_.maxBy`</a>
210 * <a href="#_meanarray">`_.mean`</a>
211 * <a href="#_minarray">`_.min`</a>
212 * <a href="#_minbyarray-iteratee_identity">`_.minBy`</a>
213 * <a href="#_roundnumber-precision0">`_.round`</a>
214 * <a href="#_subtractminuend-subtrahend">`_.subtract`</a>
215 * <a href="#_sumarray">`_.sum`</a>
216 * <a href="#_sumbyarray-iteratee_identity">`_.sumBy`</a>
223 * <a href="#_clampnumber-lower-upper">`_.clamp`</a>
224 * <a href="#_inrangenumber-start0-end">`_.inRange`</a>
225 * <a href="#_randomlower0-upper1-floating">`_.random`</a>
232 * <a href="#_assignobject-sources">`_.assign`</a>
233 * <a href="#_assigninobject-sources">`_.assignIn`</a>
234 * <a href="#_assigninwithobject-sources-customizer">`_.assignInWith`</a>
235 * <a href="#_assignwithobject-sources-customizer">`_.assignWith`</a>
236 * <a href="#_atobject-paths">`_.at`</a>
237 * <a href="#_createprototype-properties">`_.create`</a>
238 * <a href="#_defaultsobject-sources">`_.defaults`</a>
239 * <a href="#_defaultsdeepobject-sources">`_.defaultsDeep`</a>
240 * <a href="#_assigninobject-sources" class="alias">`_.extend` -> `assignIn`</a>
241 * <a href="#_assigninwithobject-sources-customizer" class="alias">`_.extendWith` -> `assignInWith`</a>
242 * <a href="#_findkeyobject-predicate_identity">`_.findKey`</a>
243 * <a href="#_findlastkeyobject-predicate_identity">`_.findLastKey`</a>
244 * <a href="#_forinobject-iteratee_identity">`_.forIn`</a>
245 * <a href="#_forinrightobject-iteratee_identity">`_.forInRight`</a>
246 * <a href="#_forownobject-iteratee_identity">`_.forOwn`</a>
247 * <a href="#_forownrightobject-iteratee_identity">`_.forOwnRight`</a>
248 * <a href="#_functionsobject">`_.functions`</a>
249 * <a href="#_functionsinobject">`_.functionsIn`</a>
250 * <a href="#_getobject-path-defaultvalue">`_.get`</a>
251 * <a href="#_hasobject-path">`_.has`</a>
252 * <a href="#_hasinobject-path">`_.hasIn`</a>
253 * <a href="#_invertobject">`_.invert`</a>
254 * <a href="#_invertbyobject-iteratee_identity">`_.invertBy`</a>
255 * <a href="#_invokeobject-path-args">`_.invoke`</a>
256 * <a href="#_keysobject">`_.keys`</a>
257 * <a href="#_keysinobject">`_.keysIn`</a>
258 * <a href="#_mapkeysobject-iteratee_identity">`_.mapKeys`</a>
259 * <a href="#_mapvaluesobject-iteratee_identity">`_.mapValues`</a>
260 * <a href="#_mergeobject-sources">`_.merge`</a>
261 * <a href="#_mergewithobject-sources-customizer">`_.mergeWith`</a>
262 * <a href="#_omitobject-props">`_.omit`</a>
263 * <a href="#_omitbyobject-predicate_identity">`_.omitBy`</a>
264 * <a href="#_pickobject-props">`_.pick`</a>
265 * <a href="#_pickbyobject-predicate_identity">`_.pickBy`</a>
266 * <a href="#_resultobject-path-defaultvalue">`_.result`</a>
267 * <a href="#_setobject-path-value">`_.set`</a>
268 * <a href="#_setwithobject-path-value-customizer">`_.setWith`</a>
269 * <a href="#_topairsobject">`_.toPairs`</a>
270 * <a href="#_topairsinobject">`_.toPairsIn`</a>
271 * <a href="#_transformobject-iteratee_identity-accumulator">`_.transform`</a>
272 * <a href="#_unsetobject-path">`_.unset`</a>
273 * <a href="#_valuesobject">`_.values`</a>
274 * <a href="#_valuesinobject">`_.valuesIn`</a>
281 * <a href="#_value">`_`</a>
282 * <a href="#_chainvalue">`_.chain`</a>
283 * <a href="#_tapvalue-interceptor">`_.tap`</a>
284 * <a href="#_thruvalue-interceptor">`_.thru`</a>
285 * <a href="#_prototypesymboliterator">`_.prototype[Symbol.iterator]`</a>
286 * <a href="#_prototypeatpaths">`_.prototype.at`</a>
287 * <a href="#_prototypechain">`_.prototype.chain`</a>
288 * <a href="#_prototypecommit">`_.prototype.commit`</a>
289 * <a href="#_prototypeflatmapiteratee_identity">`_.prototype.flatMap`</a>
290 * <a href="#_prototypenext">`_.prototype.next`</a>
291 * <a href="#_prototypeplantvalue">`_.prototype.plant`</a>
292 * <a href="#_prototypereverse">`_.prototype.reverse`</a>
293 * <a href="#_prototypevalue" class="alias">`_.prototype.toJSON` -> `value`</a>
294 * <a href="#_prototypevalue">`_.prototype.value`</a>
295 * <a href="#_prototypevalue" class="alias">`_.prototype.valueOf` -> `value`</a>
302 * <a href="#_camelcasestring">`_.camelCase`</a>
303 * <a href="#_capitalizestring">`_.capitalize`</a>
304 * <a href="#_deburrstring">`_.deburr`</a>
305 * <a href="#_endswithstring-target-positionstringlength">`_.endsWith`</a>
306 * <a href="#_escapestring">`_.escape`</a>
307 * <a href="#_escaperegexpstring">`_.escapeRegExp`</a>
308 * <a href="#_kebabcasestring">`_.kebabCase`</a>
309 * <a href="#_lowercasestring">`_.lowerCase`</a>
310 * <a href="#_lowerfirststring">`_.lowerFirst`</a>
311 * <a href="#_padstring-length0-chars">`_.pad`</a>
312 * <a href="#_padendstring-length0-chars">`_.padEnd`</a>
313 * <a href="#_padstartstring-length0-chars">`_.padStart`</a>
314 * <a href="#_parseintstring-radix10">`_.parseInt`</a>
315 * <a href="#_repeatstring-n0">`_.repeat`</a>
316 * <a href="#_replacestring-pattern-replacement">`_.replace`</a>
317 * <a href="#_snakecasestring">`_.snakeCase`</a>
318 * <a href="#_splitstring-separator-limit">`_.split`</a>
319 * <a href="#_startcasestring">`_.startCase`</a>
320 * <a href="#_startswithstring-target-position0">`_.startsWith`</a>
321 * <a href="#_templatestring-options">`_.template`</a>
322 * <a href="#_tolowerstring">`_.toLower`</a>
323 * <a href="#_toupperstring">`_.toUpper`</a>
324 * <a href="#_trimstring-charswhitespace">`_.trim`</a>
325 * <a href="#_trimendstring-charswhitespace">`_.trimEnd`</a>
326 * <a href="#_trimstartstring-charswhitespace">`_.trimStart`</a>
327 * <a href="#_truncatestring-options-optionslength30-optionsomission-optionsseparator">`_.truncate`</a>
328 * <a href="#_unescapestring">`_.unescape`</a>
329 * <a href="#_uppercasestring">`_.upperCase`</a>
330 * <a href="#_upperfirststring">`_.upperFirst`</a>
331 * <a href="#_wordsstring-pattern">`_.words`</a>
338 * <a href="#_attemptfunc">`_.attempt`</a>
339 * <a href="#_bindallobject-methodnames">`_.bindAll`</a>
340 * <a href="#_condpairs">`_.cond`</a>
341 * <a href="#_conformssource">`_.conforms`</a>
342 * <a href="#_constantvalue">`_.constant`</a>
343 * <a href="#_flowfuncs">`_.flow`</a>
344 * <a href="#_flowrightfuncs">`_.flowRight`</a>
345 * <a href="#_identityvalue">`_.identity`</a>
346 * <a href="#_iterateefunc_identity">`_.iteratee`</a>
347 * <a href="#_matchessource">`_.matches`</a>
348 * <a href="#_matchespropertypath-srcvalue">`_.matchesProperty`</a>
349 * <a href="#_methodpath-args">`_.method`</a>
350 * <a href="#_methodofobject-args">`_.methodOf`</a>
351 * <a href="#_mixinobjectlodash-source-options">`_.mixin`</a>
352 * <a href="#_noconflict">`_.noConflict`</a>
353 * <a href="#_noop">`_.noop`</a>
354 * <a href="#_nthargn0">`_.nthArg`</a>
355 * <a href="#_overiteratees">`_.over`</a>
356 * <a href="#_overeverypredicates">`_.overEvery`</a>
357 * <a href="#_oversomepredicates">`_.overSome`</a>
358 * <a href="#_propertypath">`_.property`</a>
359 * <a href="#_propertyofobject">`_.propertyOf`</a>
360 * <a href="#_rangestart0-end-step1">`_.range`</a>
361 * <a href="#_rangerightstart0-end-step1">`_.rangeRight`</a>
362 * <a href="#_runincontextcontextroot">`_.runInContext`</a>
363 * <a href="#_timesn-iteratee_identity">`_.times`</a>
364 * <a href="#_topathvalue">`_.toPath`</a>
365 * <a href="#_uniqueidprefix">`_.uniqueId`</a>
372 * <a href="#_version">`_.VERSION`</a>
373 * <a href="#_templatesettings">`_.templateSettings`</a>
374 * <a href="#_templatesettingsescape">`_.templateSettings.escape`</a>
375 * <a href="#_templatesettingsevaluate">`_.templateSettings.evaluate`</a>
376 * <a href="#_templatesettingsimports">`_.templateSettings.imports`</a>
377 * <a href="#_templatesettingsimports_">`_.templateSettings.imports._`</a>
378 * <a href="#_templatesettingsinterpolate">`_.templateSettings.interpolate`</a>
379 * <a href="#_templatesettingsvariable">`_.templateSettings.variable`</a>
385 <!-- div class="doc-container" -->
393 ### <a id="_chunkarray-size0"></a>`_.chunk(array, [size=0])`
394 <a href="#_chunkarray-size0">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L5480 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.chunk "See the npm package")
396 Creates an array of elements split into groups the length of `size`.
397 If `array` can't be split evenly, the final chunk will be the remaining
401 1. `array` *(Array)*: The array to process.
402 2. `[size=0]` *(number)*: The length of each chunk.
405 *(Array)*: Returns the new array containing chunks.
409 _.chunk(['a', 'b', 'c', 'd'], 2);
410 // => [['a', 'b'], ['c', 'd']]
412 _.chunk(['a', 'b', 'c', 'd'], 3);
413 // => [['a', 'b', 'c'], ['d']]
421 ### <a id="_compactarray"></a>`_.compact(array)`
422 <a href="#_compactarray">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L5511 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.compact "See the npm package")
424 Creates an array with all falsey values removed. The values `false`, `null`,
425 `0`, `""`, `undefined`, and `NaN` are falsey.
428 1. `array` *(Array)*: The array to compact.
431 *(Array)*: Returns the new array of filtered values.
435 _.compact([0, 1, false, 2, '', 3]);
444 ### <a id="_concatarray-values"></a>`_.concat(array, [values])`
445 <a href="#_concatarray-values">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L5547 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.concat "See the npm package")
447 Creates a new array concatenating `array` with any additional arrays
451 1. `array` *(Array)*: The array to concatenate.
452 2. `[values]` *(...*)*: The values to concatenate.
455 *(Array)*: Returns the new concatenated array.
460 var other = _.concat(array, 2, [3], [[4]]);
474 ### <a id="_differencearray-values"></a>`_.difference(array, [values])`
475 <a href="#_differencearray-values">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L5571 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.difference "See the npm package")
477 Creates an array of unique `array` values not included in the other
478 given arrays using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
479 for equality comparisons.
482 1. `array` *(Array)*: The array to inspect.
483 2. `[values]` *(...Array)*: The values to exclude.
486 *(Array)*: Returns the new array of filtered values.
490 _.difference([3, 2, 1], [4, 2]);
499 ### <a id="_differencebyarray-values-iteratee_identity"></a>`_.differenceBy(array, [values], [iteratee=_.identity])`
500 <a href="#_differencebyarray-values-iteratee_identity">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L5598 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.differenceby "See the npm package")
502 This method is like `_.difference` except that it accepts `iteratee` which
503 is invoked for each element of `array` and `values` to generate the criterion
504 by which uniqueness is computed. The iteratee is invoked with one argument: (value).
507 1. `array` *(Array)*: The array to inspect.
508 2. `[values]` *(...Array)*: The values to exclude.
509 3. `[iteratee=_.identity]` *(Function|Object|string)*: The iteratee invoked per element.
512 *(Array)*: Returns the new array of filtered values.
516 _.differenceBy([3.1, 2.2, 1.3], [4.4, 2.5], Math.floor);
519 // The `_.property` iteratee shorthand.
520 _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x');
529 ### <a id="_differencewitharray-values-comparator"></a>`_.differenceWith(array, [values], [comparator])`
530 <a href="#_differencewitharray-values-comparator">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L5627 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.differencewith "See the npm package")
532 This method is like `_.difference` except that it accepts `comparator`
533 which is invoked to compare elements of `array` to `values`. The comparator
534 is invoked with two arguments: (arrVal, othVal).
537 1. `array` *(Array)*: The array to inspect.
538 2. `[values]` *(...Array)*: The values to exclude.
539 3. `[comparator]` *(Function)*: The comparator invoked per element.
542 *(Array)*: Returns the new array of filtered values.
546 var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
548 _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual);
549 // => [{ 'x': 2, 'y': 1 }]
557 ### <a id="_droparray-n1"></a>`_.drop(array, [n=1])`
558 <a href="#_droparray-n1">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L5661 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.drop "See the npm package")
560 Creates a slice of `array` with `n` elements dropped from the beginning.
563 1. `array` *(Array)*: The array to query.
564 2. `[n=1]` *(number)*: The number of elements to drop.
567 *(Array)*: Returns the slice of `array`.
574 _.drop([1, 2, 3], 2);
577 _.drop([1, 2, 3], 5);
580 _.drop([1, 2, 3], 0);
589 ### <a id="_droprightarray-n1"></a>`_.dropRight(array, [n=1])`
590 <a href="#_droprightarray-n1">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L5694 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.dropright "See the npm package")
592 Creates a slice of `array` with `n` elements dropped from the end.
595 1. `array` *(Array)*: The array to query.
596 2. `[n=1]` *(number)*: The number of elements to drop.
599 *(Array)*: Returns the slice of `array`.
603 _.dropRight([1, 2, 3]);
606 _.dropRight([1, 2, 3], 2);
609 _.dropRight([1, 2, 3], 5);
612 _.dropRight([1, 2, 3], 0);
621 ### <a id="_droprightwhilearray-predicate_identity"></a>`_.dropRightWhile(array, [predicate=_.identity])`
622 <a href="#_droprightwhilearray-predicate_identity">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L5738 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.droprightwhile "See the npm package")
624 Creates a slice of `array` excluding elements dropped from the end.
625 Elements are dropped until `predicate` returns falsey. The predicate is
626 invoked with three arguments: (value, index, array).
629 1. `array` *(Array)*: The array to query.
630 2. `[predicate=_.identity]` *(Function|Object|string)*: The function invoked per iteration.
633 *(Array)*: Returns the slice of `array`.
638 { 'user': 'barney', 'active': true },
639 { 'user': 'fred', 'active': false },
640 { 'user': 'pebbles', 'active': false }
643 _.dropRightWhile(users, function(o) { return !o.active; });
644 // => objects for ['barney']
646 // The `_.matches` iteratee shorthand.
647 _.dropRightWhile(users, { 'user': 'pebbles', 'active': false });
648 // => objects for ['barney', 'fred']
650 // The `_.matchesProperty` iteratee shorthand.
651 _.dropRightWhile(users, ['active', false]);
652 // => objects for ['barney']
654 // The `_.property` iteratee shorthand.
655 _.dropRightWhile(users, 'active');
656 // => objects for ['barney', 'fred', 'pebbles']
664 ### <a id="_dropwhilearray-predicate_identity"></a>`_.dropWhile(array, [predicate=_.identity])`
665 <a href="#_dropwhilearray-predicate_identity">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L5778 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.dropwhile "See the npm package")
667 Creates a slice of `array` excluding elements dropped from the beginning.
668 Elements are dropped until `predicate` returns falsey. The predicate is
669 invoked with three arguments: (value, index, array).
672 1. `array` *(Array)*: The array to query.
673 2. `[predicate=_.identity]` *(Function|Object|string)*: The function invoked per iteration.
676 *(Array)*: Returns the slice of `array`.
681 { 'user': 'barney', 'active': false },
682 { 'user': 'fred', 'active': false },
683 { 'user': 'pebbles', 'active': true }
686 _.dropWhile(users, function(o) { return !o.active; });
687 // => objects for ['pebbles']
689 // The `_.matches` iteratee shorthand.
690 _.dropWhile(users, { 'user': 'barney', 'active': false });
691 // => objects for ['fred', 'pebbles']
693 // The `_.matchesProperty` iteratee shorthand.
694 _.dropWhile(users, ['active', false]);
695 // => objects for ['pebbles']
697 // The `_.property` iteratee shorthand.
698 _.dropWhile(users, 'active');
699 // => objects for ['barney', 'fred', 'pebbles']
707 ### <a id="_fillarray-value-start0-endarraylength"></a>`_.fill(array, value, [start=0], [end=array.length])`
708 <a href="#_fillarray-value-start0-endarraylength">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L5812 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.fill "See the npm package")
710 Fills elements of `array` with `value` from `start` up to, but not
714 **Note:** This method mutates `array`.
717 1. `array` *(Array)*: The array to fill.
718 2. `value` *(*)*: The value to fill `array` with.
719 3. `[start=0]` *(number)*: The start position.
720 4. `[end=array.length]` *(number)*: The end position.
723 *(Array)*: Returns `array`.
727 var array = [1, 2, 3];
731 // => ['a', 'a', 'a']
736 _.fill([4, 6, 8, 10], '*', 1, 3);
737 // => [4, '*', '*', 10]
745 ### <a id="_findindexarray-predicate_identity"></a>`_.findIndex(array, [predicate=_.identity])`
746 <a href="#_findindexarray-predicate_identity">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L5857 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.findindex "See the npm package")
748 This method is like `_.find` except that it returns the index of the first
749 element `predicate` returns truthy for instead of the element itself.
752 1. `array` *(Array)*: The array to search.
753 2. `[predicate=_.identity]` *(Function|Object|string)*: The function invoked per iteration.
756 *(number)*: Returns the index of the found element, else `-1`.
761 { 'user': 'barney', 'active': false },
762 { 'user': 'fred', 'active': false },
763 { 'user': 'pebbles', 'active': true }
766 _.findIndex(users, function(o) { return o.user == 'barney'; });
769 // The `_.matches` iteratee shorthand.
770 _.findIndex(users, { 'user': 'fred', 'active': false });
773 // The `_.matchesProperty` iteratee shorthand.
774 _.findIndex(users, ['active', false]);
777 // The `_.property` iteratee shorthand.
778 _.findIndex(users, 'active');
787 ### <a id="_findlastindexarray-predicate_identity"></a>`_.findLastIndex(array, [predicate=_.identity])`
788 <a href="#_findlastindexarray-predicate_identity">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L5896 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.findlastindex "See the npm package")
790 This method is like `_.findIndex` except that it iterates over elements
791 of `collection` from right to left.
794 1. `array` *(Array)*: The array to search.
795 2. `[predicate=_.identity]` *(Function|Object|string)*: The function invoked per iteration.
798 *(number)*: Returns the index of the found element, else `-1`.
803 { 'user': 'barney', 'active': true },
804 { 'user': 'fred', 'active': false },
805 { 'user': 'pebbles', 'active': false }
808 _.findLastIndex(users, function(o) { return o.user == 'pebbles'; });
811 // The `_.matches` iteratee shorthand.
812 _.findLastIndex(users, { 'user': 'barney', 'active': true });
815 // The `_.matchesProperty` iteratee shorthand.
816 _.findLastIndex(users, ['active', false]);
819 // The `_.property` iteratee shorthand.
820 _.findLastIndex(users, 'active');
829 ### <a id="_flattenarray"></a>`_.flatten(array)`
830 <a href="#_flattenarray">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L5915 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.flatten "See the npm package")
832 Flattens `array` a single level deep.
835 1. `array` *(Array)*: The array to flatten.
838 *(Array)*: Returns the new flattened array.
842 _.flatten([1, [2, [3, [4]], 5]]);
843 // => [1, 2, [3, [4]], 5]
851 ### <a id="_flattendeeparray"></a>`_.flattenDeep(array)`
852 <a href="#_flattendeeparray">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L5933 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.flattendeep "See the npm package")
854 Recursively flattens `array`.
857 1. `array` *(Array)*: The array to flatten.
860 *(Array)*: Returns the new flattened array.
864 _.flattenDeep([1, [2, [3, [4]], 5]]);
865 // => [1, 2, 3, 4, 5]
873 ### <a id="_flattendeptharray-depth1"></a>`_.flattenDepth(array, [depth=1])`
874 <a href="#_flattendeptharray-depth1">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L5957 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.flattendepth "See the npm package")
876 Recursively flatten `array` up to `depth` times.
879 1. `array` *(Array)*: The array to flatten.
880 2. `[depth=1]` *(number)*: The maximum recursion depth.
883 *(Array)*: Returns the new flattened array.
887 var array = [1, [2, [3, [4]], 5]];
889 _.flattenDepth(array, 1);
890 // => [1, 2, [3, [4]], 5]
892 _.flattenDepth(array, 2);
893 // => [1, 2, 3, [4], 5]
901 ### <a id="_frompairspairs"></a>`_.fromPairs(pairs)`
902 <a href="#_frompairspairs">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L5980 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.frompairs "See the npm package")
904 The inverse of `_.toPairs`; this method returns an object composed
905 from key-value `pairs`.
908 1. `pairs` *(Array)*: The key-value pairs.
911 *(Object)*: Returns the new object.
915 _.fromPairs([['fred', 30], ['barney', 40]]);
916 // => { 'fred': 30, 'barney': 40 }
924 ### <a id="_headarray"></a>`_.head(array)`
925 <a href="#_headarray">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L6009 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.head "See the npm package")
927 Gets the first element of `array`.
933 1. `array` *(Array)*: The array to query.
936 *(*)*: Returns the first element of `array`.
952 ### <a id="_indexofarray-value-fromindex0"></a>`_.indexOf(array, value, [fromIndex=0])`
953 <a href="#_indexofarray-value-fromindex0">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L6035 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.indexof "See the npm package")
955 Gets the index at which the first occurrence of `value` is found in `array`
956 using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
957 for equality comparisons. If `fromIndex` is negative, it's used as the offset
958 from the end of `array`.
961 1. `array` *(Array)*: The array to search.
962 2. `value` *(*)*: The value to search for.
963 3. `[fromIndex=0]` *(number)*: The index to search from.
966 *(number)*: Returns the index of the matched value, else `-1`.
970 _.indexOf([1, 2, 1, 2], 2);
973 // Search from the `fromIndex`.
974 _.indexOf([1, 2, 1, 2], 2, 2);
983 ### <a id="_initialarray"></a>`_.initial(array)`
984 <a href="#_initialarray">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L6060 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.initial "See the npm package")
986 Gets all but the last element of `array`.
989 1. `array` *(Array)*: The array to query.
992 *(Array)*: Returns the slice of `array`.
996 _.initial([1, 2, 3]);
1005 ### <a id="_intersectionarrays"></a>`_.intersection([arrays])`
1006 <a href="#_intersectionarrays">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L6079 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.intersection "See the npm package")
1008 Creates an array of unique values that are included in all given arrays
1009 using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
1010 for equality comparisons.
1013 1. `[arrays]` *(...Array)*: The arrays to inspect.
1016 *(Array)*: Returns the new array of shared values.
1020 _.intersection([2, 1], [4, 2], [1, 2]);
1029 ### <a id="_intersectionbyarrays-iteratee_identity"></a>`_.intersectionBy([arrays], [iteratee=_.identity])`
1030 <a href="#_intersectionbyarrays-iteratee_identity">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L6106 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.intersectionby "See the npm package")
1032 This method is like `_.intersection` except that it accepts `iteratee`
1033 which is invoked for each element of each `arrays` to generate the criterion
1034 by which uniqueness is computed. The iteratee is invoked with one argument: (value).
1037 1. `[arrays]` *(...Array)*: The arrays to inspect.
1038 2. `[iteratee=_.identity]` *(Function|Object|string)*: The iteratee invoked per element.
1041 *(Array)*: Returns the new array of shared values.
1045 _.intersectionBy([2.1, 1.2], [4.3, 2.4], Math.floor);
1048 // The `_.property` iteratee shorthand.
1049 _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
1058 ### <a id="_intersectionwitharrays-comparator"></a>`_.intersectionWith([arrays], [comparator])`
1059 <a href="#_intersectionwitharrays-comparator">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L6139 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.intersectionwith "See the npm package")
1061 This method is like `_.intersection` except that it accepts `comparator`
1062 which is invoked to compare elements of `arrays`. The comparator is invoked
1063 with two arguments: (arrVal, othVal).
1066 1. `[arrays]` *(...Array)*: The arrays to inspect.
1067 2. `[comparator]` *(Function)*: The comparator invoked per element.
1070 *(Array)*: Returns the new array of shared values.
1074 var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
1075 var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
1077 _.intersectionWith(objects, others, _.isEqual);
1078 // => [{ 'x': 1, 'y': 2 }]
1086 ### <a id="_joinarray-separator-"></a>`_.join(array, [separator=','])`
1087 <a href="#_joinarray-separator-">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L6167 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.join "See the npm package")
1089 Converts all elements in `array` into a string separated by `separator`.
1092 1. `array` *(Array)*: The array to convert.
1093 2. `[separator=',']` *(string)*: The element separator.
1096 *(string)*: Returns the joined string.
1100 _.join(['a', 'b', 'c'], '~');
1109 ### <a id="_lastarray"></a>`_.last(array)`
1110 <a href="#_lastarray">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L6184 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.last "See the npm package")
1112 Gets the last element of `array`.
1115 1. `array` *(Array)*: The array to query.
1118 *(*)*: Returns the last element of `array`.
1131 ### <a id="_lastindexofarray-value-fromindexarraylength-1"></a>`_.lastIndexOf(array, value, [fromIndex=array.length-1])`
1132 <a href="#_lastindexofarray-value-fromindexarraylength-1">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L6209 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.lastindexof "See the npm package")
1134 This method is like `_.indexOf` except that it iterates over elements of
1135 `array` from right to left.
1138 1. `array` *(Array)*: The array to search.
1139 2. `value` *(*)*: The value to search for.
1140 3. `[fromIndex=array.length-1]` *(number)*: The index to search from.
1143 *(number)*: Returns the index of the matched value, else `-1`.
1147 _.lastIndexOf([1, 2, 1, 2], 2);
1150 // Search from the `fromIndex`.
1151 _.lastIndexOf([1, 2, 1, 2], 2, 2);
1160 ### <a id="_pullarray-values"></a>`_.pull(array, [values])`
1161 <a href="#_pullarray-values">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L6252 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.pull "See the npm package")
1163 Removes all given values from `array` using
1164 [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
1165 for equality comparisons.
1168 **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove`
1169 to remove elements from an array by predicate.
1172 1. `array` *(Array)*: The array to modify.
1173 2. `[values]` *(...*)*: The values to remove.
1176 *(Array)*: Returns `array`.
1180 var array = [1, 2, 3, 1, 2, 3];
1182 _.pull(array, 2, 3);
1192 ### <a id="_pullallarray-values"></a>`_.pullAll(array, values)`
1193 <a href="#_pullallarray-values">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L6273 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.pullall "See the npm package")
1195 This method is like `_.pull` except that it accepts an array of values to remove.
1198 **Note:** Unlike `_.difference`, this method mutates `array`.
1201 1. `array` *(Array)*: The array to modify.
1202 2. `values` *(Array)*: The values to remove.
1205 *(Array)*: Returns `array`.
1209 var array = [1, 2, 3, 1, 2, 3];
1211 _.pullAll(array, [2, 3]);
1221 ### <a id="_pullallbyarray-values-iteratee_identity"></a>`_.pullAllBy(array, values, [iteratee=_.identity])`
1222 <a href="#_pullallbyarray-values-iteratee_identity">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L6301 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.pullallby "See the npm package")
1224 This method is like `_.pullAll` except that it accepts `iteratee` which is
1225 invoked for each element of `array` and `values` to generate the criterion
1226 by which uniqueness is computed. The iteratee is invoked with one argument: (value).
1229 **Note:** Unlike `_.differenceBy`, this method mutates `array`.
1232 1. `array` *(Array)*: The array to modify.
1233 2. `values` *(Array)*: The values to remove.
1234 3. `[iteratee=_.identity]` *(Function|Object|string)*: The iteratee invoked per element.
1237 *(Array)*: Returns `array`.
1241 var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];
1243 _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x');
1253 ### <a id="_pullatarray-indexes"></a>`_.pullAt(array, [indexes])`
1254 <a href="#_pullatarray-indexes">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L6331 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.pullat "See the npm package")
1256 Removes elements from `array` corresponding to `indexes` and returns an
1257 array of removed elements.
1260 **Note:** Unlike `_.at`, this method mutates `array`.
1263 1. `array` *(Array)*: The array to modify.
1264 2. `[indexes]` *(...(number|number[])*: The indexes of elements to remove, specified individually or in arrays.
1267 *(Array)*: Returns the new array of removed elements.
1271 var array = [5, 10, 15, 20];
1272 var evens = _.pullAt(array, 1, 3);
1286 ### <a id="_removearray-predicate_identity"></a>`_.remove(array, [predicate=_.identity])`
1287 <a href="#_removearray-predicate_identity">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L6366 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.remove "See the npm package")
1289 Removes all elements from `array` that `predicate` returns truthy for
1290 and returns an array of the removed elements. The predicate is invoked
1291 with three arguments: (value, index, array).
1294 **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull`
1295 to pull elements from an array by value.
1298 1. `array` *(Array)*: The array to modify.
1299 2. `[predicate=_.identity]` *(Function|Object|string)*: The function invoked per iteration.
1302 *(Array)*: Returns the new array of removed elements.
1306 var array = [1, 2, 3, 4];
1307 var evens = _.remove(array, function(n) {
1323 ### <a id="_reverse"></a>`_.reverse()`
1324 <a href="#_reverse">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L6408 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.reverse "See the npm package")
1326 Reverses `array` so that the first element becomes the last, the second
1327 element becomes the second to last, and so on.
1330 **Note:** This method mutates `array` and is based on
1331 [`Array#reverse`](https://mdn.io/Array/reverse).
1334 *(Array)*: Returns `array`.
1338 var array = [1, 2, 3];
1352 ### <a id="_slicearray-start0-endarraylength"></a>`_.slice(array, [start=0], [end=array.length])`
1353 <a href="#_slicearray-start0-endarraylength">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L6426 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.slice "See the npm package")
1355 Creates a slice of `array` from `start` up to, but not including, `end`.
1358 **Note:** This method is used instead of [`Array#slice`](https://mdn.io/Array/slice)
1359 to ensure dense arrays are returned.
1362 1. `array` *(Array)*: The array to slice.
1363 2. `[start=0]` *(number)*: The start position.
1364 3. `[end=array.length]` *(number)*: The end position.
1367 *(Array)*: Returns the slice of `array`.
1375 ### <a id="_sortedindexarray-value"></a>`_.sortedIndex(array, value)`
1376 <a href="#_sortedindexarray-value">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L6460 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.sortedindex "See the npm package")
1378 Uses a binary search to determine the lowest index at which `value` should
1379 be inserted into `array` in order to maintain its sort order.
1382 1. `array` *(Array)*: The sorted array to inspect.
1383 2. `value` *(*)*: The value to evaluate.
1386 *(number)*: Returns the index at which `value` should be inserted into `array`.
1390 _.sortedIndex([30, 50], 40);
1393 _.sortedIndex([4, 5], 4);
1402 ### <a id="_sortedindexbyarray-value-iteratee_identity"></a>`_.sortedIndexBy(array, value, [iteratee=_.identity])`
1403 <a href="#_sortedindexbyarray-value-iteratee_identity">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L6487 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.sortedindexby "See the npm package")
1405 This method is like `_.sortedIndex` except that it accepts `iteratee`
1406 which is invoked for `value` and each element of `array` to compute their
1407 sort ranking. The iteratee is invoked with one argument: (value).
1410 1. `array` *(Array)*: The sorted array to inspect.
1411 2. `value` *(*)*: The value to evaluate.
1412 3. `[iteratee=_.identity]` *(Function|Object|string)*: The iteratee invoked per element.
1415 *(number)*: Returns the index at which `value` should be inserted into `array`.
1419 var dict = { 'thirty': 30, 'forty': 40, 'fifty': 50 };
1421 _.sortedIndexBy(['thirty', 'fifty'], 'forty', _.propertyOf(dict));
1424 // The `_.property` iteratee shorthand.
1425 _.sortedIndexBy([{ 'x': 4 }, { 'x': 5 }], { 'x': 4 }, 'x');
1434 ### <a id="_sortedindexofarray-value"></a>`_.sortedIndexOf(array, value)`
1435 <a href="#_sortedindexofarray-value">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L6506 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.sortedindexof "See the npm package")
1437 This method is like `_.indexOf` except that it performs a binary
1438 search on a sorted `array`.
1441 1. `array` *(Array)*: The array to search.
1442 2. `value` *(*)*: The value to search for.
1445 *(number)*: Returns the index of the matched value, else `-1`.
1449 _.sortedIndexOf([1, 1, 2, 2], 2);
1458 ### <a id="_sortedlastindexarray-value"></a>`_.sortedLastIndex(array, value)`
1459 <a href="#_sortedlastindexarray-value">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L6533 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.sortedlastindex "See the npm package")
1461 This method is like `_.sortedIndex` except that it returns the highest
1462 index at which `value` should be inserted into `array` in order to
1463 maintain its sort order.
1466 1. `array` *(Array)*: The sorted array to inspect.
1467 2. `value` *(*)*: The value to evaluate.
1470 *(number)*: Returns the index at which `value` should be inserted into `array`.
1474 _.sortedLastIndex([4, 5], 4);
1483 ### <a id="_sortedlastindexbyarray-value-iteratee_identity"></a>`_.sortedLastIndexBy(array, value, [iteratee=_.identity])`
1484 <a href="#_sortedlastindexbyarray-value-iteratee_identity">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L6555 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.sortedlastindexby "See the npm package")
1486 This method is like `_.sortedLastIndex` except that it accepts `iteratee`
1487 which is invoked for `value` and each element of `array` to compute their
1488 sort ranking. The iteratee is invoked with one argument: (value).
1491 1. `array` *(Array)*: The sorted array to inspect.
1492 2. `value` *(*)*: The value to evaluate.
1493 3. `[iteratee=_.identity]` *(Function|Object|string)*: The iteratee invoked per element.
1496 *(number)*: Returns the index at which `value` should be inserted into `array`.
1500 // The `_.property` iteratee shorthand.
1501 _.sortedLastIndexBy([{ 'x': 4 }, { 'x': 5 }], { 'x': 4 }, 'x');
1510 ### <a id="_sortedlastindexofarray-value"></a>`_.sortedLastIndexOf(array, value)`
1511 <a href="#_sortedlastindexofarray-value">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L6574 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.sortedlastindexof "See the npm package")
1513 This method is like `_.lastIndexOf` except that it performs a binary
1514 search on a sorted `array`.
1517 1. `array` *(Array)*: The array to search.
1518 2. `value` *(*)*: The value to search for.
1521 *(number)*: Returns the index of the matched value, else `-1`.
1525 _.sortedLastIndexOf([1, 1, 2, 2], 2);
1534 ### <a id="_sorteduniqarray"></a>`_.sortedUniq(array)`
1535 <a href="#_sorteduniqarray">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L6599 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.sorteduniq "See the npm package")
1537 This method is like `_.uniq` except that it's designed and optimized
1541 1. `array` *(Array)*: The array to inspect.
1544 *(Array)*: Returns the new duplicate free array.
1548 _.sortedUniq([1, 1, 2]);
1557 ### <a id="_sorteduniqbyarray-iteratee"></a>`_.sortedUniqBy(array, [iteratee])`
1558 <a href="#_sorteduniqbyarray-iteratee">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L6620 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.sorteduniqby "See the npm package")
1560 This method is like `_.uniqBy` except that it's designed and optimized
1564 1. `array` *(Array)*: The array to inspect.
1565 2. `[iteratee]` *(Function)*: The iteratee invoked per element.
1568 *(Array)*: Returns the new duplicate free array.
1572 _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor);
1581 ### <a id="_tailarray"></a>`_.tail(array)`
1582 <a href="#_tailarray">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L6639 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.tail "See the npm package")
1584 Gets all but the first element of `array`.
1587 1. `array` *(Array)*: The array to query.
1590 *(Array)*: Returns the slice of `array`.
1603 ### <a id="_takearray-n1"></a>`_.take(array, [n=1])`
1604 <a href="#_takearray-n1">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L6667 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.take "See the npm package")
1606 Creates a slice of `array` with `n` elements taken from the beginning.
1609 1. `array` *(Array)*: The array to query.
1610 2. `[n=1]` *(number)*: The number of elements to take.
1613 *(Array)*: Returns the slice of `array`.
1620 _.take([1, 2, 3], 2);
1623 _.take([1, 2, 3], 5);
1626 _.take([1, 2, 3], 0);
1635 ### <a id="_takerightarray-n1"></a>`_.takeRight(array, [n=1])`
1636 <a href="#_takerightarray-n1">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L6699 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.takeright "See the npm package")
1638 Creates a slice of `array` with `n` elements taken from the end.
1641 1. `array` *(Array)*: The array to query.
1642 2. `[n=1]` *(number)*: The number of elements to take.
1645 *(Array)*: Returns the slice of `array`.
1649 _.takeRight([1, 2, 3]);
1652 _.takeRight([1, 2, 3], 2);
1655 _.takeRight([1, 2, 3], 5);
1658 _.takeRight([1, 2, 3], 0);
1667 ### <a id="_takerightwhilearray-predicate_identity"></a>`_.takeRightWhile(array, [predicate=_.identity])`
1668 <a href="#_takerightwhilearray-predicate_identity">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L6743 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.takerightwhile "See the npm package")
1670 Creates a slice of `array` with elements taken from the end. Elements are
1671 taken until `predicate` returns falsey. The predicate is invoked with three
1672 arguments: (value, index, array).
1675 1. `array` *(Array)*: The array to query.
1676 2. `[predicate=_.identity]` *(Function|Object|string)*: The function invoked per iteration.
1679 *(Array)*: Returns the slice of `array`.
1684 { 'user': 'barney', 'active': true },
1685 { 'user': 'fred', 'active': false },
1686 { 'user': 'pebbles', 'active': false }
1689 _.takeRightWhile(users, function(o) { return !o.active; });
1690 // => objects for ['fred', 'pebbles']
1692 // The `_.matches` iteratee shorthand.
1693 _.takeRightWhile(users, { 'user': 'pebbles', 'active': false });
1694 // => objects for ['pebbles']
1696 // The `_.matchesProperty` iteratee shorthand.
1697 _.takeRightWhile(users, ['active', false]);
1698 // => objects for ['fred', 'pebbles']
1700 // The `_.property` iteratee shorthand.
1701 _.takeRightWhile(users, 'active');
1710 ### <a id="_takewhilearray-predicate_identity"></a>`_.takeWhile(array, [predicate=_.identity])`
1711 <a href="#_takewhilearray-predicate_identity">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L6783 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.takewhile "See the npm package")
1713 Creates a slice of `array` with elements taken from the beginning. Elements
1714 are taken until `predicate` returns falsey. The predicate is invoked with
1715 three arguments: (value, index, array).
1718 1. `array` *(Array)*: The array to query.
1719 2. `[predicate=_.identity]` *(Function|Object|string)*: The function invoked per iteration.
1722 *(Array)*: Returns the slice of `array`.
1727 { 'user': 'barney', 'active': false },
1728 { 'user': 'fred', 'active': false},
1729 { 'user': 'pebbles', 'active': true }
1732 _.takeWhile(users, function(o) { return !o.active; });
1733 // => objects for ['barney', 'fred']
1735 // The `_.matches` iteratee shorthand.
1736 _.takeWhile(users, { 'user': 'barney', 'active': false });
1737 // => objects for ['barney']
1739 // The `_.matchesProperty` iteratee shorthand.
1740 _.takeWhile(users, ['active', false]);
1741 // => objects for ['barney', 'fred']
1743 // The `_.property` iteratee shorthand.
1744 _.takeWhile(users, 'active');
1753 ### <a id="_unionarrays"></a>`_.union([arrays])`
1754 <a href="#_unionarrays">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L6804 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.union "See the npm package")
1756 Creates an array of unique values, in order, from all given arrays using
1757 [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
1758 for equality comparisons.
1761 1. `[arrays]` *(...Array)*: The arrays to inspect.
1764 *(Array)*: Returns the new array of combined values.
1768 _.union([2, 1], [4, 2], [1, 2]);
1777 ### <a id="_unionbyarrays-iteratee_identity"></a>`_.unionBy([arrays], [iteratee=_.identity])`
1778 <a href="#_unionbyarrays-iteratee_identity">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L6828 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.unionby "See the npm package")
1780 This method is like `_.union` except that it accepts `iteratee` which is
1781 invoked for each element of each `arrays` to generate the criterion by which
1782 uniqueness is computed. The iteratee is invoked with one argument: (value).
1785 1. `[arrays]` *(...Array)*: The arrays to inspect.
1786 2. `[iteratee=_.identity]` *(Function|Object|string)*: The iteratee invoked per element.
1789 *(Array)*: Returns the new array of combined values.
1793 _.unionBy([2.1, 1.2], [4.3, 2.4], Math.floor);
1794 // => [2.1, 1.2, 4.3]
1796 // The `_.property` iteratee shorthand.
1797 _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
1798 // => [{ 'x': 1 }, { 'x': 2 }]
1806 ### <a id="_unionwitharrays-comparator"></a>`_.unionWith([arrays], [comparator])`
1807 <a href="#_unionwitharrays-comparator">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L6855 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.unionwith "See the npm package")
1809 This method is like `_.union` except that it accepts `comparator` which
1810 is invoked to compare elements of `arrays`. The comparator is invoked
1811 with two arguments: (arrVal, othVal).
1814 1. `[arrays]` *(...Array)*: The arrays to inspect.
1815 2. `[comparator]` *(Function)*: The comparator invoked per element.
1818 *(Array)*: Returns the new array of combined values.
1822 var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
1823 var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
1825 _.unionWith(objects, others, _.isEqual);
1826 // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
1834 ### <a id="_uniqarray"></a>`_.uniq(array)`
1835 <a href="#_uniqarray">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L6879 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.uniq "See the npm package")
1837 Creates a duplicate-free version of an array, using
1838 [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
1839 for equality comparisons, in which only the first occurrence of each element
1843 1. `array` *(Array)*: The array to inspect.
1846 *(Array)*: Returns the new duplicate free array.
1859 ### <a id="_uniqbyarray-iteratee_identity"></a>`_.uniqBy(array, [iteratee=_.identity])`
1860 <a href="#_uniqbyarray-iteratee_identity">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L6905 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.uniqby "See the npm package")
1862 This method is like `_.uniq` except that it accepts `iteratee` which is
1863 invoked for each element in `array` to generate the criterion by which
1864 uniqueness is computed. The iteratee is invoked with one argument: (value).
1867 1. `array` *(Array)*: The array to inspect.
1868 2. `[iteratee=_.identity]` *(Function|Object|string)*: The iteratee invoked per element.
1871 *(Array)*: Returns the new duplicate free array.
1875 _.uniqBy([2.1, 1.2, 2.3], Math.floor);
1878 // The `_.property` iteratee shorthand.
1879 _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');
1880 // => [{ 'x': 1 }, { 'x': 2 }]
1888 ### <a id="_uniqwitharray-comparator"></a>`_.uniqWith(array, [comparator])`
1889 <a href="#_uniqwitharray-comparator">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L6929 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.uniqwith "See the npm package")
1891 This method is like `_.uniq` except that it accepts `comparator` which
1892 is invoked to compare elements of `array`. The comparator is invoked with
1893 two arguments: (arrVal, othVal).
1896 1. `array` *(Array)*: The array to inspect.
1897 2. `[comparator]` *(Function)*: The comparator invoked per element.
1900 *(Array)*: Returns the new duplicate free array.
1904 var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }];
1906 _.uniqWith(objects, _.isEqual);
1907 // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]
1915 ### <a id="_unziparray"></a>`_.unzip(array)`
1916 <a href="#_unziparray">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L6953 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.unzip "See the npm package")
1918 This method is like `_.zip` except that it accepts an array of grouped
1919 elements and creates an array regrouping the elements to their pre-zip
1923 1. `array` *(Array)*: The array of grouped elements to process.
1926 *(Array)*: Returns the new array of regrouped elements.
1930 var zipped = _.zip(['fred', 'barney'], [30, 40], [true, false]);
1931 // => [['fred', 30, true], ['barney', 40, false]]
1934 // => [['fred', 'barney'], [30, 40], [true, false]]
1942 ### <a id="_unzipwitharray-iteratee_identity"></a>`_.unzipWith(array, [iteratee=_.identity])`
1943 <a href="#_unzipwitharray-iteratee_identity">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L6988 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.unzipwith "See the npm package")
1945 This method is like `_.unzip` except that it accepts `iteratee` to specify
1946 how regrouped values should be combined. The iteratee is invoked with the
1947 elements of each group: (...group).
1950 1. `array` *(Array)*: The array of grouped elements to process.
1951 2. `[iteratee=_.identity]` *(Function)*: The function to combine regrouped values.
1954 *(Array)*: Returns the new array of regrouped elements.
1958 var zipped = _.zip([1, 2], [10, 20], [100, 200]);
1959 // => [[1, 10, 100], [2, 20, 200]]
1961 _.unzipWith(zipped, _.add);
1970 ### <a id="_withoutarray-values"></a>`_.without(array, [values])`
1971 <a href="#_withoutarray-values">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L7017 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.without "See the npm package")
1973 Creates an array excluding all given values using
1974 [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
1975 for equality comparisons.
1978 1. `array` *(Array)*: The array to filter.
1979 2. `[values]` *(...*)*: The values to exclude.
1982 *(Array)*: Returns the new array of filtered values.
1986 _.without([1, 2, 1, 3], 1, 2);
1995 ### <a id="_xorarrays"></a>`_.xor([arrays])`
1996 <a href="#_xorarrays">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L7037 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.xor "See the npm package")
1998 Creates an array of unique values that is the [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)
1999 of the given arrays.
2002 1. `[arrays]` *(...Array)*: The arrays to inspect.
2005 *(Array)*: Returns the new array of values.
2009 _.xor([2, 1], [4, 2]);
2018 ### <a id="_xorbyarrays-iteratee_identity"></a>`_.xorBy([arrays], [iteratee=_.identity])`
2019 <a href="#_xorbyarrays-iteratee_identity">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L7061 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.xorby "See the npm package")
2021 This method is like `_.xor` except that it accepts `iteratee` which is
2022 invoked for each element of each `arrays` to generate the criterion by which
2023 uniqueness is computed. The iteratee is invoked with one argument: (value).
2026 1. `[arrays]` *(...Array)*: The arrays to inspect.
2027 2. `[iteratee=_.identity]` *(Function|Object|string)*: The iteratee invoked per element.
2030 *(Array)*: Returns the new array of values.
2034 _.xorBy([2.1, 1.2], [4.3, 2.4], Math.floor);
2037 // The `_.property` iteratee shorthand.
2038 _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
2047 ### <a id="_xorwitharrays-comparator"></a>`_.xorWith([arrays], [comparator])`
2048 <a href="#_xorwitharrays-comparator">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L7088 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.xorwith "See the npm package")
2050 This method is like `_.xor` except that it accepts `comparator` which is
2051 invoked to compare elements of `arrays`. The comparator is invoked with
2052 two arguments: (arrVal, othVal).
2055 1. `[arrays]` *(...Array)*: The arrays to inspect.
2056 2. `[comparator]` *(Function)*: The comparator invoked per element.
2059 *(Array)*: Returns the new array of values.
2063 var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
2064 var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
2066 _.xorWith(objects, others, _.isEqual);
2067 // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
2075 ### <a id="_ziparrays"></a>`_.zip([arrays])`
2076 <a href="#_ziparrays">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L7111 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.zip "See the npm package")
2078 Creates an array of grouped elements, the first of which contains the first
2079 elements of the given arrays, the second of which contains the second elements
2080 of the given arrays, and so on.
2083 1. `[arrays]` *(...Array)*: The arrays to process.
2086 *(Array)*: Returns the new array of grouped elements.
2090 _.zip(['fred', 'barney'], [30, 40], [true, false]);
2091 // => [['fred', 30, true], ['barney', 40, false]]
2099 ### <a id="_zipobjectprops-values"></a>`_.zipObject([props=[]], [values=[]])`
2100 <a href="#_zipobjectprops-values">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L7128 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.zipobject "See the npm package")
2102 This method is like `_.fromPairs` except that it accepts two arrays,
2103 one of property names and one of corresponding values.
2106 1. `[props=[]]` *(Array)*: The property names.
2107 2. `[values=[]]` *(Array)*: The property values.
2110 *(Object)*: Returns the new object.
2114 _.zipObject(['a', 'b'], [1, 2]);
2115 // => { 'a': 1, 'b': 2 }
2123 ### <a id="_zipobjectdeepprops-values"></a>`_.zipObjectDeep([props=[]], [values=[]])`
2124 <a href="#_zipobjectdeepprops-values">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L7146 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.zipobjectdeep "See the npm package")
2126 This method is like `_.zipObject` except that it supports property paths.
2129 1. `[props=[]]` *(Array)*: The property names.
2130 2. `[values=[]]` *(Array)*: The property values.
2133 *(Object)*: Returns the new object.
2137 _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]);
2138 // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } }
2146 ### <a id="_zipwitharrays-iteratee_identity"></a>`_.zipWith([arrays], [iteratee=_.identity])`
2147 <a href="#_zipwitharrays-iteratee_identity">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L7168 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.zipwith "See the npm package")
2149 This method is like `_.zip` except that it accepts `iteratee` to specify
2150 how grouped values should be combined. The iteratee is invoked with the
2151 elements of each group: (...group).
2154 1. `[arrays]` *(...Array)*: The arrays to process.
2155 2. `[iteratee=_.identity]` *(Function)*: The function to combine grouped values.
2158 *(Array)*: Returns the new array of grouped elements.
2162 _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) {
2175 ## `“Collection” Methods`
2179 ### <a id="_countbycollection-iteratee_identity"></a>`_.countBy(collection, [iteratee=_.identity])`
2180 <a href="#_countbycollection-iteratee_identity">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L7559 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.countby "See the npm package")
2182 Creates an object composed of keys generated from the results of running
2183 each element of `collection` through `iteratee`. The corresponding value
2184 of each key is the number of times the key was returned by `iteratee`.
2185 The iteratee is invoked with one argument: (value).
2188 1. `collection` *(Array|Object)*: The collection to iterate over.
2189 2. `[iteratee=_.identity]` *(Function|Object|string)*: The iteratee to transform keys.
2192 *(Object)*: Returns the composed aggregate object.
2196 _.countBy([6.1, 4.2, 6.3], Math.floor);
2197 // => { '4': 1, '6': 2 }
2199 _.countBy(['one', 'two', 'three'], 'length');
2200 // => { '3': 2, '5': 1 }
2208 ### <a id="_everycollection-predicate_identity"></a>`_.every(collection, [predicate=_.identity])`
2209 <a href="#_everycollection-predicate_identity">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L7597 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.every "See the npm package")
2211 Checks if `predicate` returns truthy for **all** elements of `collection`.
2212 Iteration is stopped once `predicate` returns falsey. The predicate is
2213 invoked with three arguments: (value, index|key, collection).
2216 1. `collection` *(Array|Object)*: The collection to iterate over.
2217 2. `[predicate=_.identity]` *(Function|Object|string)*: The function invoked per iteration.
2220 *(boolean)*: Returns `true` if all elements pass the predicate check, else `false`.
2224 _.every([true, 1, null, 'yes'], Boolean);
2228 { 'user': 'barney', 'active': false },
2229 { 'user': 'fred', 'active': false }
2232 // The `_.matches` iteratee shorthand.
2233 _.every(users, { 'user': 'barney', 'active': false });
2236 // The `_.matchesProperty` iteratee shorthand.
2237 _.every(users, ['active', false]);
2240 // The `_.property` iteratee shorthand.
2241 _.every(users, 'active');
2250 ### <a id="_filtercollection-predicate_identity"></a>`_.filter(collection, [predicate=_.identity])`
2251 <a href="#_filtercollection-predicate_identity">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L7638 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.filter "See the npm package")
2253 Iterates over elements of `collection`, returning an array of all elements
2254 `predicate` returns truthy for. The predicate is invoked with three arguments:<br>
2255 (value, index|key, collection).
2258 1. `collection` *(Array|Object)*: The collection to iterate over.
2259 2. `[predicate=_.identity]` *(Function|Object|string)*: The function invoked per iteration.
2262 *(Array)*: Returns the new filtered array.
2267 { 'user': 'barney', 'age': 36, 'active': true },
2268 { 'user': 'fred', 'age': 40, 'active': false }
2271 _.filter(users, function(o) { return !o.active; });
2272 // => objects for ['fred']
2274 // The `_.matches` iteratee shorthand.
2275 _.filter(users, { 'age': 36, 'active': true });
2276 // => objects for ['barney']
2278 // The `_.matchesProperty` iteratee shorthand.
2279 _.filter(users, ['active', false]);
2280 // => objects for ['fred']
2282 // The `_.property` iteratee shorthand.
2283 _.filter(users, 'active');
2284 // => objects for ['barney']
2292 ### <a id="_findcollection-predicate_identity"></a>`_.find(collection, [predicate=_.identity])`
2293 <a href="#_findcollection-predicate_identity">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L7677 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.find "See the npm package")
2295 Iterates over elements of `collection`, returning the first element
2296 `predicate` returns truthy for. The predicate is invoked with three arguments:<br>
2297 (value, index|key, collection).
2300 1. `collection` *(Array|Object)*: The collection to search.
2301 2. `[predicate=_.identity]` *(Function|Object|string)*: The function invoked per iteration.
2304 *(*)*: Returns the matched element, else `undefined`.
2309 { 'user': 'barney', 'age': 36, 'active': true },
2310 { 'user': 'fred', 'age': 40, 'active': false },
2311 { 'user': 'pebbles', 'age': 1, 'active': true }
2314 _.find(users, function(o) { return o.age < 40; });
2315 // => object for 'barney'
2317 // The `_.matches` iteratee shorthand.
2318 _.find(users, { 'age': 1, 'active': true });
2319 // => object for 'pebbles'
2321 // The `_.matchesProperty` iteratee shorthand.
2322 _.find(users, ['active', false]);
2323 // => object for 'fred'
2325 // The `_.property` iteratee shorthand.
2326 _.find(users, 'active');
2327 // => object for 'barney'
2335 ### <a id="_findlastcollection-predicate_identity"></a>`_.findLast(collection, [predicate=_.identity])`
2336 <a href="#_findlastcollection-predicate_identity">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L7703 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.findlast "See the npm package")
2338 This method is like `_.find` except that it iterates over elements of
2339 `collection` from right to left.
2342 1. `collection` *(Array|Object)*: The collection to search.
2343 2. `[predicate=_.identity]` *(Function|Object|string)*: The function invoked per iteration.
2346 *(*)*: Returns the matched element, else `undefined`.
2350 _.findLast([1, 2, 3, 4], function(n) {
2361 ### <a id="_flatmapcollection-iteratee_identity"></a>`_.flatMap(collection, [iteratee=_.identity])`
2362 <a href="#_flatmapcollection-iteratee_identity">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L7732 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.flatmap "See the npm package")
2364 Creates an array of flattened values by running each element in `collection`
2365 through `iteratee` and concating its result to the other mapped values.
2366 The iteratee is invoked with three arguments: (value, index|key, collection).
2369 1. `collection` *(Array|Object)*: The collection to iterate over.
2370 2. `[iteratee=_.identity]` *(Function|Object|string)*: The function invoked per iteration.
2373 *(Array)*: Returns the new flattened array.
2377 function duplicate(n) {
2381 _.flatMap([1, 2], duplicate);
2390 ### <a id="_foreachcollection-iteratee_identity"></a>`_.forEach(collection, [iteratee=_.identity])`
2391 <a href="#_foreachcollection-iteratee_identity">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L7764 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.foreach "See the npm package")
2393 Iterates over elements of `collection` invoking `iteratee` for each element.
2394 The iteratee is invoked with three arguments: (value, index|key, collection).
2395 Iteratee functions may exit iteration early by explicitly returning `false`.
2398 **Note:** As with other "Collections" methods, objects with a "length" property
2399 are iterated like arrays. To avoid this behavior use `_.forIn` or `_.forOwn`
2400 for object iteration.
2406 1. `collection` *(Array|Object)*: The collection to iterate over.
2407 2. `[iteratee=_.identity]` *(Function)*: The function invoked per iteration.
2410 *(Array|Object)*: Returns `collection`.
2414 _([1, 2]).forEach(function(value) {
2417 // => logs `1` then `2`
2419 _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {
2422 // => logs 'a' then 'b' (iteration order is not guaranteed)
2430 ### <a id="_foreachrightcollection-iteratee_identity"></a>`_.forEachRight(collection, [iteratee=_.identity])`
2431 <a href="#_foreachrightcollection-iteratee_identity">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L7788 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.foreachright "See the npm package")
2433 This method is like `_.forEach` except that it iterates over elements of
2434 `collection` from right to left.
2440 1. `collection` *(Array|Object)*: The collection to iterate over.
2441 2. `[iteratee=_.identity]` *(Function)*: The function invoked per iteration.
2444 *(Array|Object)*: Returns `collection`.
2448 _.forEachRight([1, 2], function(value) {
2451 // => logs `2` then `1`
2459 ### <a id="_groupbycollection-iteratee_identity"></a>`_.groupBy(collection, [iteratee=_.identity])`
2460 <a href="#_groupbycollection-iteratee_identity">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L7815 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.groupby "See the npm package")
2462 Creates an object composed of keys generated from the results of running
2463 each element of `collection` through `iteratee`. The corresponding value
2464 of each key is an array of elements responsible for generating the key.
2465 The iteratee is invoked with one argument: (value).
2468 1. `collection` *(Array|Object)*: The collection to iterate over.
2469 2. `[iteratee=_.identity]` *(Function|Object|string)*: The iteratee to transform keys.
2472 *(Object)*: Returns the composed aggregate object.
2476 _.groupBy([6.1, 4.2, 6.3], Math.floor);
2477 // => { '4': [4.2], '6': [6.1, 6.3] }
2479 // The `_.property` iteratee shorthand.
2480 _.groupBy(['one', 'two', 'three'], 'length');
2481 // => { '3': ['one', 'two'], '5': ['three'] }
2489 ### <a id="_includescollection-value-fromindex0"></a>`_.includes(collection, value, [fromIndex=0])`
2490 <a href="#_includescollection-value-fromindex0">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L7851 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.includes "See the npm package")
2492 Checks if `value` is in `collection`. If `collection` is a string it's checked
2493 for a substring of `value`, otherwise [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
2494 is used for equality comparisons. If `fromIndex` is negative, it's used as
2495 the offset from the end of `collection`.
2498 1. `collection` *(Array|Object|string)*: The collection to search.
2499 2. `value` *(*)*: The value to search for.
2500 3. `[fromIndex=0]` *(number)*: The index to search from.
2503 *(boolean)*: Returns `true` if `value` is found, else `false`.
2507 _.includes([1, 2, 3], 1);
2510 _.includes([1, 2, 3], 1, 2);
2513 _.includes({ 'user': 'fred', 'age': 40 }, 'fred');
2516 _.includes('pebbles', 'eb');
2525 ### <a id="_invokemapcollection-path-args"></a>`_.invokeMap(collection, path, [args])`
2526 <a href="#_invokemapcollection-path-args">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L7886 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.invokemap "See the npm package")
2528 Invokes the method at `path` of each element in `collection`, returning
2529 an array of the results of each invoked method. Any additional arguments
2530 are provided to each invoked method. If `methodName` is a function it's
2531 invoked for, and `this` bound to, each element in `collection`.
2534 1. `collection` *(Array|Object)*: The collection to iterate over.
2535 2. `path` *(Array|Function|string)*: The path of the method to invoke or the function invoked per iteration.
2536 3. `[args]` *(...*)*: The arguments to invoke each method with.
2539 *(Array)*: Returns the array of results.
2543 _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort');
2544 // => [[1, 5, 7], [1, 2, 3]]
2546 _.invokeMap([123, 456], String.prototype.split, '');
2547 // => [['1', '2', '3'], ['4', '5', '6']]
2555 ### <a id="_keybycollection-iteratee_identity"></a>`_.keyBy(collection, [iteratee=_.identity])`
2556 <a href="#_keybycollection-iteratee_identity">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L7926 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.keyby "See the npm package")
2558 Creates an object composed of keys generated from the results of running
2559 each element of `collection` through `iteratee`. The corresponding value
2560 of each key is the last element responsible for generating the key. The
2561 iteratee is invoked with one argument: (value).
2564 1. `collection` *(Array|Object)*: The collection to iterate over.
2565 2. `[iteratee=_.identity]` *(Function|Object|string)*: The iteratee to transform keys.
2568 *(Object)*: Returns the composed aggregate object.
2573 { 'dir': 'left', 'code': 97 },
2574 { 'dir': 'right', 'code': 100 }
2577 _.keyBy(array, function(o) {
2578 return String.fromCharCode(o.code);
2580 // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
2582 _.keyBy(array, 'dir');
2583 // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }
2591 ### <a id="_mapcollection-iteratee_identity"></a>`_.map(collection, [iteratee=_.identity])`
2592 <a href="#_mapcollection-iteratee_identity">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L7971 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.map "See the npm package")
2594 Creates an array of values by running each element in `collection` through
2595 `iteratee`. The iteratee is invoked with three arguments:<br>
2596 (value, index|key, collection).
2599 Many lodash methods are guarded to work as iteratees for methods like
2600 `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
2603 The guarded methods are:<br>
2604 `ary`, `curry`, `curryRight`, `drop`, `dropRight`, `every`, `fill`,
2605 `invert`, `parseInt`, `random`, `range`, `rangeRight`, `slice`, `some`,
2606 `sortBy`, `take`, `takeRight`, `template`, `trim`, `trimEnd`, `trimStart`,
2610 1. `collection` *(Array|Object)*: The collection to iterate over.
2611 2. `[iteratee=_.identity]` *(Function|Object|string)*: The function invoked per iteration.
2614 *(Array)*: Returns the new mapped array.
2618 function square(n) {
2622 _.map([4, 8], square);
2625 _.map({ 'a': 4, 'b': 8 }, square);
2626 // => [16, 64] (iteration order is not guaranteed)
2629 { 'user': 'barney' },
2633 // The `_.property` iteratee shorthand.
2634 _.map(users, 'user');
2635 // => ['barney', 'fred']
2643 ### <a id="_orderbycollection-iteratees-_identity-orders"></a>`_.orderBy(collection, [iteratees=[_.identity]], [orders])`
2644 <a href="#_orderbycollection-iteratees-_identity-orders">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L8003 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.orderby "See the npm package")
2646 This method is like `_.sortBy` except that it allows specifying the sort
2647 orders of the iteratees to sort by. If `orders` is unspecified, all values
2648 are sorted in ascending order. Otherwise, specify an order of "desc" for
2649 descending or "asc" for ascending sort order of corresponding values.
2652 1. `collection` *(Array|Object)*: The collection to iterate over.
2653 2. `[iteratees=[_.identity]]` *(Function[]|Object[]|string[])*: The iteratees to sort by.
2654 3. `[orders]` *(string[])*: The sort orders of `iteratees`.
2657 *(Array)*: Returns the new sorted array.
2662 { 'user': 'fred', 'age': 48 },
2663 { 'user': 'barney', 'age': 34 },
2664 { 'user': 'fred', 'age': 42 },
2665 { 'user': 'barney', 'age': 36 }
2668 // Sort by `user` in ascending order and by `age` in descending order.
2669 _.orderBy(users, ['user', 'age'], ['asc', 'desc']);
2670 // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]]
2678 ### <a id="_partitioncollection-predicate_identity"></a>`_.partition(collection, [predicate=_.identity])`
2679 <a href="#_partitioncollection-predicate_identity">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L8052 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.partition "See the npm package")
2681 Creates an array of elements split into two groups, the first of which
2682 contains elements `predicate` returns truthy for, the second of which
2683 contains elements `predicate` returns falsey for. The predicate is
2684 invoked with one argument: (value).
2687 1. `collection` *(Array|Object)*: The collection to iterate over.
2688 2. `[predicate=_.identity]` *(Function|Object|string)*: The function invoked per iteration.
2691 *(Array)*: Returns the array of grouped elements.
2696 { 'user': 'barney', 'age': 36, 'active': false },
2697 { 'user': 'fred', 'age': 40, 'active': true },
2698 { 'user': 'pebbles', 'age': 1, 'active': false }
2701 _.partition(users, function(o) { return o.active; });
2702 // => objects for [['fred'], ['barney', 'pebbles']]
2704 // The `_.matches` iteratee shorthand.
2705 _.partition(users, { 'age': 1, 'active': false });
2706 // => objects for [['pebbles'], ['barney', 'fred']]
2708 // The `_.matchesProperty` iteratee shorthand.
2709 _.partition(users, ['active', false]);
2710 // => objects for [['barney', 'pebbles'], ['fred']]
2712 // The `_.property` iteratee shorthand.
2713 _.partition(users, 'active');
2714 // => objects for [['fred'], ['barney', 'pebbles']]
2722 ### <a id="_reducecollection-iteratee_identity-accumulator"></a>`_.reduce(collection, [iteratee=_.identity], [accumulator])`
2723 <a href="#_reducecollection-iteratee_identity-accumulator">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L8091 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.reduce "See the npm package")
2725 Reduces `collection` to a value which is the accumulated result of running
2726 each element in `collection` through `iteratee`, where each successive
2727 invocation is supplied the return value of the previous. If `accumulator`
2728 is not given the first element of `collection` is used as the initial
2729 value. The iteratee is invoked with four arguments:<br>
2730 (accumulator, value, index|key, collection).
2733 Many lodash methods are guarded to work as iteratees for methods like
2734 `_.reduce`, `_.reduceRight`, and `_.transform`.
2737 The guarded methods are:<br>
2738 `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,
2742 1. `collection` *(Array|Object)*: The collection to iterate over.
2743 2. `[iteratee=_.identity]` *(Function)*: The function invoked per iteration.
2744 3. `[accumulator]` *(*)*: The initial value.
2747 *(*)*: Returns the accumulated value.
2751 _.reduce([1, 2], function(sum, n) {
2756 _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
2757 (result[value] || (result[value] = [])).push(key);
2760 // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)
2768 ### <a id="_reducerightcollection-iteratee_identity-accumulator"></a>`_.reduceRight(collection, [iteratee=_.identity], [accumulator])`
2769 <a href="#_reducerightcollection-iteratee_identity-accumulator">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L8118 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.reduceright "See the npm package")
2771 This method is like `_.reduce` except that it iterates over elements of
2772 `collection` from right to left.
2775 1. `collection` *(Array|Object)*: The collection to iterate over.
2776 2. `[iteratee=_.identity]` *(Function)*: The function invoked per iteration.
2777 3. `[accumulator]` *(*)*: The initial value.
2780 *(*)*: Returns the accumulated value.
2784 var array = [[0, 1], [2, 3], [4, 5]];
2786 _.reduceRight(array, function(flattened, other) {
2787 return flattened.concat(other);
2789 // => [4, 5, 2, 3, 0, 1]
2797 ### <a id="_rejectcollection-predicate_identity"></a>`_.reject(collection, [predicate=_.identity])`
2798 <a href="#_rejectcollection-predicate_identity">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L8157 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.reject "See the npm package")
2800 The opposite of `_.filter`; this method returns the elements of `collection`
2801 that `predicate` does **not** return truthy for.
2804 1. `collection` *(Array|Object)*: The collection to iterate over.
2805 2. `[predicate=_.identity]` *(Function|Object|string)*: The function invoked per iteration.
2808 *(Array)*: Returns the new filtered array.
2813 { 'user': 'barney', 'age': 36, 'active': false },
2814 { 'user': 'fred', 'age': 40, 'active': true }
2817 _.reject(users, function(o) { return !o.active; });
2818 // => objects for ['fred']
2820 // The `_.matches` iteratee shorthand.
2821 _.reject(users, { 'age': 40, 'active': true });
2822 // => objects for ['barney']
2824 // The `_.matchesProperty` iteratee shorthand.
2825 _.reject(users, ['active', false]);
2826 // => objects for ['fred']
2828 // The `_.property` iteratee shorthand.
2829 _.reject(users, 'active');
2830 // => objects for ['barney']
2838 ### <a id="_samplecollection"></a>`_.sample(collection)`
2839 <a href="#_samplecollection">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L8178 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.sample "See the npm package")
2841 Gets a random element from `collection`.
2844 1. `collection` *(Array|Object)*: The collection to sample.
2847 *(*)*: Returns the random element.
2851 _.sample([1, 2, 3, 4]);
2860 ### <a id="_samplesizecollection-n0"></a>`_.sampleSize(collection, [n=0])`
2861 <a href="#_samplesizecollection-n0">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L8203 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.samplesize "See the npm package")
2863 Gets `n` random elements at unique keys from `collection` up to the
2864 size of `collection`.
2867 1. `collection` *(Array|Object)*: The collection to sample.
2868 2. `[n=0]` *(number)*: The number of elements to sample.
2871 *(Array)*: Returns the random elements.
2875 _.sampleSize([1, 2, 3], 2);
2878 _.sampleSize([1, 2, 3], 4);
2887 ### <a id="_shufflecollection"></a>`_.shuffle(collection)`
2888 <a href="#_shufflecollection">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L8235 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.shuffle "See the npm package")
2890 Creates an array of shuffled values, using a version of the
2891 [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).
2894 1. `collection` *(Array|Object)*: The collection to shuffle.
2897 *(Array)*: Returns the new shuffled array.
2901 _.shuffle([1, 2, 3, 4]);
2910 ### <a id="_sizecollection"></a>`_.size(collection)`
2911 <a href="#_sizecollection">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L8259 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.size "See the npm package")
2913 Gets the size of `collection` by returning its length for array-like
2914 values or the number of own enumerable properties for objects.
2917 1. `collection` *(Array|Object)*: The collection to inspect.
2920 *(number)*: Returns the collection size.
2927 _.size({ 'a': 1, 'b': 2 });
2939 ### <a id="_somecollection-predicate_identity"></a>`_.some(collection, [predicate=_.identity])`
2940 <a href="#_somecollection-predicate_identity">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L8304 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.some "See the npm package")
2942 Checks if `predicate` returns truthy for **any** element of `collection`.
2943 Iteration is stopped once `predicate` returns truthy. The predicate is
2944 invoked with three arguments: (value, index|key, collection).
2947 1. `collection` *(Array|Object)*: The collection to iterate over.
2948 2. `[predicate=_.identity]` *(Function|Object|string)*: The function invoked per iteration.
2951 *(boolean)*: Returns `true` if any element passes the predicate check, else `false`.
2955 _.some([null, 0, 'yes', false], Boolean);
2959 { 'user': 'barney', 'active': true },
2960 { 'user': 'fred', 'active': false }
2963 // The `_.matches` iteratee shorthand.
2964 _.some(users, { 'user': 'barney', 'active': false });
2967 // The `_.matchesProperty` iteratee shorthand.
2968 _.some(users, ['active', false]);
2971 // The `_.property` iteratee shorthand.
2972 _.some(users, 'active');
2981 ### <a id="_sortbycollection-iteratees-_identity"></a>`_.sortBy(collection, [iteratees=[_.identity]])`
2982 <a href="#_sortbycollection-iteratees-_identity">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L8345 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.sortby "See the npm package")
2984 Creates an array of elements, sorted in ascending order by the results of
2985 running each element in a collection through each iteratee. This method
2986 performs a stable sort, that is, it preserves the original sort order of
2987 equal elements. The iteratees are invoked with one argument: (value).
2990 1. `collection` *(Array|Object)*: The collection to iterate over.
2991 2. `[iteratees=[_.identity]]` *(...(Function|Function[]|Object|Object[]|string|string[])*: The iteratees to sort by, specified individually or in arrays.
2994 *(Array)*: Returns the new sorted array.
2999 { 'user': 'fred', 'age': 48 },
3000 { 'user': 'barney', 'age': 36 },
3001 { 'user': 'fred', 'age': 42 },
3002 { 'user': 'barney', 'age': 34 }
3005 _.sortBy(users, function(o) { return o.user; });
3006 // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]]
3008 _.sortBy(users, ['user', 'age']);
3009 // => objects for [['barney', 34], ['barney', 36], ['fred', 42], ['fred', 48]]
3011 _.sortBy(users, 'user', function(o) {
3012 return Math.floor(o.age / 10);
3014 // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]]
3028 ### <a id="_now"></a>`_.now()`
3029 <a href="#_now">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L8376 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.now "See the npm package")
3031 ({Function}): Gets the timestamp of the number of milliseconds that have elapsed since
3032 the Unix epoch (1 January 1970 00:00:00 UTC).
3035 *(number)*: Returns the timestamp.
3039 _.defer(function(stamp) {
3040 console.log(_.now() - stamp);
3042 // => logs the number of milliseconds it took for the deferred function to be invoked
3052 ## `“Function” Methods`
3056 ### <a id="_aftern-func"></a>`_.after(n, func)`
3057 <a href="#_aftern-func">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L8403 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.after "See the npm package")
3059 The opposite of `_.before`; this method creates a function that invokes
3060 `func` once it's called `n` or more times.
3063 1. `n` *(number)*: The number of calls before `func` is invoked.
3064 2. `func` *(Function)*: The function to restrict.
3067 *(Function)*: Returns the new restricted function.
3071 var saves = ['profile', 'settings'];
3073 var done = _.after(saves.length, function() {
3074 console.log('done saving!');
3077 _.forEach(saves, function(type) {
3078 asyncSave({ 'type': type, 'complete': done });
3080 // => logs 'done saving!' after the two async saves have completed
3088 ### <a id="_aryfunc-nfunclength"></a>`_.ary(func, [n=func.length])`
3089 <a href="#_aryfunc-nfunclength">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L8431 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.ary "See the npm package")
3091 Creates a function that accepts up to `n` arguments, ignoring any
3092 additional arguments.
3095 1. `func` *(Function)*: The function to cap arguments for.
3096 2. `[n=func.length]` *(number)*: The arity cap.
3099 *(Function)*: Returns the new function.
3103 _.map(['6', '8', '10'], _.ary(parseInt, 1));
3112 ### <a id="_beforen-func"></a>`_.before(n, func)`
3113 <a href="#_beforen-func">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L8453 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.before "See the npm package")
3115 Creates a function that invokes `func`, with the `this` binding and arguments
3116 of the created function, while it's called less than `n` times. Subsequent
3117 calls to the created function return the result of the last `func` invocation.
3120 1. `n` *(number)*: The number of calls at which `func` is no longer invoked.
3121 2. `func` *(Function)*: The function to restrict.
3124 *(Function)*: Returns the new restricted function.
3128 jQuery(element).on('click', _.before(5, addContactToList));
3129 // => allows adding up to 4 contacts to the list
3137 ### <a id="_bindfunc-thisarg-partials"></a>`_.bind(func, thisArg, [partials])`
3138 <a href="#_bindfunc-thisarg-partials">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L8505 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.bind "See the npm package")
3140 Creates a function that invokes `func` with the `this` binding of `thisArg`
3141 and prepends any additional `_.bind` arguments to those provided to the
3145 The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,
3146 may be used as a placeholder for partially applied arguments.
3149 **Note:** Unlike native `Function#bind` this method doesn't set the "length"
3150 property of bound functions.
3153 1. `func` *(Function)*: The function to bind.
3154 2. `thisArg` *(*)*: The `this` binding of `func`.
3155 3. `[partials]` *(...*)*: The arguments to be partially applied.
3158 *(Function)*: Returns the new bound function.
3162 var greet = function(greeting, punctuation) {
3163 return greeting + ' ' + this.user + punctuation;
3166 var object = { 'user': 'fred' };
3168 var bound = _.bind(greet, object, 'hi');
3172 // Bound with placeholders.
3173 var bound = _.bind(greet, object, _, '!');
3183 ### <a id="_bindkeyobject-key-partials"></a>`_.bindKey(object, key, [partials])`
3184 <a href="#_bindkeyobject-key-partials">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L8558 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.bindkey "See the npm package")
3186 Creates a function that invokes the method at `object[key]` and prepends
3187 any additional `_.bindKey` arguments to those provided to the bound function.
3190 This method differs from `_.bind` by allowing bound functions to reference
3191 methods that may be redefined or don't yet exist.
3192 See [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)
3196 The `_.bindKey.placeholder` value, which defaults to `_` in monolithic
3197 builds, may be used as a placeholder for partially applied arguments.
3200 1. `object` *(Object)*: The object to invoke the method on.
3201 2. `key` *(string)*: The key of the method.
3202 3. `[partials]` *(...*)*: The arguments to be partially applied.
3205 *(Function)*: Returns the new bound function.
3211 'greet': function(greeting, punctuation) {
3212 return greeting + ' ' + this.user + punctuation;
3216 var bound = _.bindKey(object, 'greet', 'hi');
3220 object.greet = function(greeting, punctuation) {
3221 return greeting + 'ya ' + this.user + punctuation;
3227 // Bound with placeholders.
3228 var bound = _.bindKey(object, 'greet', _, '!');
3238 ### <a id="_curryfunc-arityfunclength"></a>`_.curry(func, [arity=func.length])`
3239 <a href="#_curryfunc-arityfunclength">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L8607 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.curry "See the npm package")
3241 Creates a function that accepts arguments of `func` and either invokes
3242 `func` returning its result, if at least `arity` number of arguments have
3243 been provided, or returns a function that accepts the remaining `func`
3244 arguments, and so on. The arity of `func` may be specified if `func.length`
3248 The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,
3249 may be used as a placeholder for provided arguments.
3252 **Note:** This method doesn't set the "length" property of curried functions.
3255 1. `func` *(Function)*: The function to curry.
3256 2. `[arity=func.length]` *(number)*: The arity of `func`.
3259 *(Function)*: Returns the new curried function.
3263 var abc = function(a, b, c) {
3267 var curried = _.curry(abc);
3278 // Curried with placeholders.
3279 curried(1)(_, 3)(2);
3288 ### <a id="_curryrightfunc-arityfunclength"></a>`_.curryRight(func, [arity=func.length])`
3289 <a href="#_curryrightfunc-arityfunclength">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L8651 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.curryright "See the npm package")
3291 This method is like `_.curry` except that arguments are applied to `func`
3292 in the manner of `_.partialRight` instead of `_.partial`.
3295 The `_.curryRight.placeholder` value, which defaults to `_` in monolithic
3296 builds, may be used as a placeholder for provided arguments.
3299 **Note:** This method doesn't set the "length" property of curried functions.
3302 1. `func` *(Function)*: The function to curry.
3303 2. `[arity=func.length]` *(number)*: The arity of `func`.
3306 *(Function)*: Returns the new curried function.
3310 var abc = function(a, b, c) {
3314 var curried = _.curryRight(abc);
3325 // Curried with placeholders.
3326 curried(3)(1, _)(2);
3335 ### <a id="_debouncefunc-wait0-options"></a>`_.debounce(func, [wait=0], [options])`
3336 <a href="#_debouncefunc-wait0-options">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L8707 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.debounce "See the npm package")
3338 Creates a debounced function that delays invoking `func` until after `wait`
3339 milliseconds have elapsed since the last time the debounced function was
3340 invoked. The debounced function comes with a `cancel` method to cancel
3341 delayed `func` invocations and a `flush` method to immediately invoke them.
3342 Provide an options object to indicate whether `func` should be invoked on
3343 the leading and/or trailing edge of the `wait` timeout. The `func` is invoked
3344 with the last arguments provided to the debounced function. Subsequent calls
3345 to the debounced function return the result of the last `func` invocation.
3348 **Note:** If `leading` and `trailing` options are `true`, `func` is invoked
3349 on the trailing edge of the timeout only if the debounced function is
3350 invoked more than once during the `wait` timeout.
3353 See [David Corbacho's article](http://drupalmotion.com/article/debounce-and-throttle-visual-explanation)
3354 for details over the differences between `_.debounce` and `_.throttle`.
3357 1. `func` *(Function)*: The function to debounce.
3358 2. `[wait=0]` *(number)*: The number of milliseconds to delay.
3359 3. `[options]` *(Object)*: The options object.
3360 4. `[options.leading=false]` *(boolean)*: Specify invoking on the leading edge of the timeout.
3361 5. `[options.maxWait]` *(number)*: The maximum time `func` is allowed to be delayed before it's invoked.
3362 6. `[options.trailing=true]` *(boolean)*: Specify invoking on the trailing edge of the timeout.
3365 *(Function)*: Returns the new debounced function.
3369 // Avoid costly calculations while the window size is in flux.
3370 jQuery(window).on('resize', _.debounce(calculateLayout, 150));
3372 // Invoke `sendMail` when clicked, debouncing subsequent calls.
3373 jQuery(element).on('click', _.debounce(sendMail, 300, {
3378 // Ensure `batchLog` is invoked once after 1 second of debounced calls.
3379 var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
3380 var source = new EventSource('/stream');
3381 jQuery(source).on('message', debounced);
3383 // Cancel the trailing debounced invocation.
3384 jQuery(window).on('popstate', debounced.cancel);
3392 ### <a id="_deferfunc-args"></a>`_.defer(func, [args])`
3393 <a href="#_deferfunc-args">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L8841 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.defer "See the npm package")
3395 Defers invoking the `func` until the current call stack has cleared. Any
3396 additional arguments are provided to `func` when it's invoked.
3399 1. `func` *(Function)*: The function to defer.
3400 2. `[args]` *(...*)*: The arguments to invoke `func` with.
3403 *(number)*: Returns the timer id.
3407 _.defer(function(text) {
3410 // => logs 'deferred' after one or more milliseconds
3418 ### <a id="_delayfunc-wait-args"></a>`_.delay(func, wait, [args])`
3419 <a href="#_delayfunc-wait-args">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L8863 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.delay "See the npm package")
3421 Invokes `func` after `wait` milliseconds. Any additional arguments are
3422 provided to `func` when it's invoked.
3425 1. `func` *(Function)*: The function to delay.
3426 2. `wait` *(number)*: The number of milliseconds to delay invocation.
3427 3. `[args]` *(...*)*: The arguments to invoke `func` with.
3430 *(number)*: Returns the timer id.
3434 _.delay(function(text) {
3437 // => logs 'later' after one second
3445 ### <a id="_flipfunc"></a>`_.flip(func)`
3446 <a href="#_flipfunc">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L8884 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.flip "See the npm package")
3448 Creates a function that invokes `func` with arguments reversed.
3451 1. `func` *(Function)*: The function to flip arguments for.
3454 *(Function)*: Returns the new function.
3458 var flipped = _.flip(function() {
3459 return _.toArray(arguments);
3462 flipped('a', 'b', 'c', 'd');
3463 // => ['d', 'c', 'b', 'a']
3471 ### <a id="_memoizefunc-resolver"></a>`_.memoize(func, [resolver])`
3472 <a href="#_memoizefunc-resolver">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L8930 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.memoize "See the npm package")
3474 Creates a function that memoizes the result of `func`. If `resolver` is
3475 provided it determines the cache key for storing the result based on the
3476 arguments provided to the memoized function. By default, the first argument
3477 provided to the memoized function is used as the map cache key. The `func`
3478 is invoked with the `this` binding of the memoized function.
3481 **Note:** The cache is exposed as the `cache` property on the memoized
3482 function. Its creation may be customized by replacing the `_.memoize.Cache`
3483 constructor with one whose instances implement the [`Map`](http://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-map-prototype-object)
3484 method interface of `delete`, `get`, `has`, and `set`.
3487 1. `func` *(Function)*: The function to have its output memoized.
3488 2. `[resolver]` *(Function)*: The function to resolve the cache key.
3491 *(Function)*: Returns the new memoizing function.
3495 var object = { 'a': 1, 'b': 2 };
3496 var other = { 'c': 3, 'd': 4 };
3498 var values = _.memoize(_.values);
3509 // Modify the result cache.
3510 values.cache.set(object, ['a', 'b']);
3514 // Replace `_.memoize.Cache`.
3515 _.memoize.Cache = WeakMap;
3523 ### <a id="_negatepredicate"></a>`_.negate(predicate)`
3524 <a href="#_negatepredicate">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L8969 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.negate "See the npm package")
3526 Creates a function that negates the result of the predicate `func`. The
3527 `func` predicate is invoked with the `this` binding and arguments of the
3531 1. `predicate` *(Function)*: The predicate to negate.
3534 *(Function)*: Returns the new function.
3538 function isEven(n) {
3542 _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));
3551 ### <a id="_oncefunc"></a>`_.once(func)`
3552 <a href="#_oncefunc">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L8995 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.once "See the npm package")
3554 Creates a function that is restricted to invoking `func` once. Repeat calls
3555 to the function return the value of the first invocation. The `func` is
3556 invoked with the `this` binding and arguments of the created function.
3559 1. `func` *(Function)*: The function to restrict.
3562 *(Function)*: Returns the new restricted function.
3566 var initialize = _.once(createApplication);
3569 // `initialize` invokes `createApplication` once
3577 ### <a id="_overargsfunc-transforms"></a>`_.overArgs(func, [transforms])`
3578 <a href="#_overargsfunc-transforms">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L9030 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.overargs "See the npm package")
3580 Creates a function that invokes `func` with arguments transformed by
3581 corresponding `transforms`.
3584 1. `func` *(Function)*: The function to wrap.
3585 2. `[transforms]` *(...(Function|Function[])*: The functions to transform arguments, specified individually or in arrays.
3588 *(Function)*: Returns the new function.
3592 function doubled(n) {
3596 function square(n) {
3600 var func = _.overArgs(function(x, y) {
3602 }, square, doubled);
3616 ### <a id="_partialfunc-partials"></a>`_.partial(func, [partials])`
3617 <a href="#_partialfunc-partials">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L9077 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.partial "See the npm package")
3619 Creates a function that invokes `func` with `partial` arguments prepended
3620 to those provided to the new function. This method is like `_.bind` except
3621 it does **not** alter the `this` binding.
3624 The `_.partial.placeholder` value, which defaults to `_` in monolithic
3625 builds, may be used as a placeholder for partially applied arguments.
3628 **Note:** This method doesn't set the "length" property of partially
3632 1. `func` *(Function)*: The function to partially apply arguments to.
3633 2. `[partials]` *(...*)*: The arguments to be partially applied.
3636 *(Function)*: Returns the new partially applied function.
3640 var greet = function(greeting, name) {
3641 return greeting + ' ' + name;
3644 var sayHelloTo = _.partial(greet, 'hello');
3648 // Partially applied with placeholders.
3649 var greetFred = _.partial(greet, _, 'fred');
3659 ### <a id="_partialrightfunc-partials"></a>`_.partialRight(func, [partials])`
3660 <a href="#_partialrightfunc-partials">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L9113 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.partialright "See the npm package")
3662 This method is like `_.partial` except that partially applied arguments
3663 are appended to those provided to the new function.
3666 The `_.partialRight.placeholder` value, which defaults to `_` in monolithic
3667 builds, may be used as a placeholder for partially applied arguments.
3670 **Note:** This method doesn't set the "length" property of partially
3674 1. `func` *(Function)*: The function to partially apply arguments to.
3675 2. `[partials]` *(...*)*: The arguments to be partially applied.
3678 *(Function)*: Returns the new partially applied function.
3682 var greet = function(greeting, name) {
3683 return greeting + ' ' + name;
3686 var greetFred = _.partialRight(greet, 'fred');
3690 // Partially applied with placeholders.
3691 var sayHelloTo = _.partialRight(greet, 'hello', _);
3701 ### <a id="_reargfunc-indexes"></a>`_.rearg(func, indexes)`
3702 <a href="#_reargfunc-indexes">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L9140 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.rearg "See the npm package")
3704 Creates a function that invokes `func` with arguments arranged according
3705 to the specified indexes where the argument value at the first index is
3706 provided as the first argument, the argument value at the second index is
3707 provided as the second argument, and so on.
3710 1. `func` *(Function)*: The function to rearrange arguments for.
3711 2. `indexes` *(...(number|number[])*: The arranged argument indexes, specified individually or in arrays.
3714 *(Function)*: Returns the new function.
3718 var rearged = _.rearg(function(a, b, c) {
3722 rearged('b', 'c', 'a')
3723 // => ['a', 'b', 'c']
3731 ### <a id="_restfunc-startfunclength-1"></a>`_.rest(func, [start=func.length-1])`
3732 <a href="#_restfunc-startfunclength-1">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L9166 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.rest "See the npm package")
3734 Creates a function that invokes `func` with the `this` binding of the
3735 created function and arguments from `start` and beyond provided as an array.
3738 **Note:** This method is based on the [rest parameter](https://mdn.io/rest_parameters).
3741 1. `func` *(Function)*: The function to apply a rest parameter to.
3742 2. `[start=func.length-1]` *(number)*: The start position of the rest parameter.
3745 *(Function)*: Returns the new function.
3749 var say = _.rest(function(what, names) {
3750 return what + ' ' + _.initial(names).join(', ') +
3751 (_.size(names) > 1 ? ', & ' : '') + _.last(names);
3754 say('hello', 'fred', 'barney', 'pebbles');
3755 // => 'hello fred, barney, & pebbles'
3763 ### <a id="_spreadfunc-start0"></a>`_.spread(func, [start=0])`
3764 <a href="#_spreadfunc-start0">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L9226 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.spread "See the npm package")
3766 Creates a function that invokes `func` with the `this` binding of the created
3767 function and an array of arguments much like [`Function#apply`](https://es5.github.io/#x15.3.4.3).
3770 **Note:** This method is based on the [spread operator](https://mdn.io/spread_operator).
3773 1. `func` *(Function)*: The function to spread arguments over.
3774 2. `[start=0]` *(number)*: The start position of the spread.
3777 *(Function)*: Returns the new function.
3781 var say = _.spread(function(who, what) {
3782 return who + ' says ' + what;
3785 say(['fred', 'hello']);
3786 // => 'fred says hello'
3788 var numbers = Promise.all([
3789 Promise.resolve(40),
3793 numbers.then(_.spread(function(x, y) {
3796 // => a Promise of 76
3804 ### <a id="_throttlefunc-wait0-options"></a>`_.throttle(func, [wait=0], [options])`
3805 <a href="#_throttlefunc-wait0-options">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L9282 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.throttle "See the npm package")
3807 Creates a throttled function that only invokes `func` at most once per
3808 every `wait` milliseconds. The throttled function comes with a `cancel`
3809 method to cancel delayed `func` invocations and a `flush` method to
3810 immediately invoke them. Provide an options object to indicate whether
3811 `func` should be invoked on the leading and/or trailing edge of the `wait`
3812 timeout. The `func` is invoked with the last arguments provided to the
3813 throttled function. Subsequent calls to the throttled function return the
3814 result of the last `func` invocation.
3817 **Note:** If `leading` and `trailing` options are `true`, `func` is invoked
3818 on the trailing edge of the timeout only if the throttled function is
3819 invoked more than once during the `wait` timeout.
3822 See [David Corbacho's article](http://drupalmotion.com/article/debounce-and-throttle-visual-explanation)
3823 for details over the differences between `_.throttle` and `_.debounce`.
3826 1. `func` *(Function)*: The function to throttle.
3827 2. `[wait=0]` *(number)*: The number of milliseconds to throttle invocations to.
3828 3. `[options]` *(Object)*: The options object.
3829 4. `[options.leading=true]` *(boolean)*: Specify invoking on the leading edge of the timeout.
3830 5. `[options.trailing=true]` *(boolean)*: Specify invoking on the trailing edge of the timeout.
3833 *(Function)*: Returns the new throttled function.
3837 // Avoid excessively updating the position while scrolling.
3838 jQuery(window).on('scroll', _.throttle(updatePosition, 100));
3840 // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.
3841 var throttled = _.throttle(renewToken, 300000, { 'trailing': false });
3842 jQuery(element).on('click', throttled);
3844 // Cancel the trailing throttled invocation.
3845 jQuery(window).on('popstate', throttled.cancel);
3853 ### <a id="_unaryfunc"></a>`_.unary(func)`
3854 <a href="#_unaryfunc">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L9314 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.unary "See the npm package")
3856 Creates a function that accepts up to one argument, ignoring any
3857 additional arguments.
3860 1. `func` *(Function)*: The function to cap arguments for.
3863 *(Function)*: Returns the new function.
3867 _.map(['6', '8', '10'], _.unary(parseInt));
3876 ### <a id="_wrapvalue-wrapperidentity"></a>`_.wrap(value, [wrapper=identity])`
3877 <a href="#_wrapvalue-wrapperidentity">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L9339 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.wrap "See the npm package")
3879 Creates a function that provides `value` to the wrapper function as its
3880 first argument. Any additional arguments provided to the function are
3881 appended to those provided to the wrapper function. The wrapper is invoked
3882 with the `this` binding of the created function.
3885 1. `value` *(*)*: The value to wrap.
3886 2. `[wrapper=identity]` *(Function)*: The wrapper function.
3889 *(Function)*: Returns the new function.
3893 var p = _.wrap(_.escape, function(func, text) {
3894 return '<p>' + func(text) + '</p>';
3897 p('fred, barney, & pebbles');
3898 // => '<p>fred, barney, & pebbles</p>'
3912 ### <a id="_castarrayvalue"></a>`_.castArray(value)`
3913 <a href="#_castarrayvalue">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L9378 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.castarray "See the npm package")
3915 Casts `value` as an array if it's not one.
3918 1. `value` *(*)*: The value to inspect.
3921 *(Array)*: Returns the cast array.
3928 _.castArray({ 'a': 1 });
3937 _.castArray(undefined);
3943 var array = [1, 2, 3];
3944 console.log(_.castArray(array) === array);
3953 ### <a id="_clonevalue"></a>`_.clone(value)`
3954 <a href="#_clonevalue">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L9410 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.clone "See the npm package")
3956 Creates a shallow clone of `value`.
3959 **Note:** This method is loosely based on the
3960 [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)
3961 and supports cloning arrays, array buffers, booleans, date objects, maps,
3962 numbers, `Object` objects, regexes, sets, strings, symbols, and typed
3963 arrays. The own enumerable properties of `arguments` objects are cloned
3964 as plain objects. An empty object is returned for uncloneable values such
3965 as error objects, functions, DOM nodes, and WeakMaps.
3968 1. `value` *(*)*: The value to clone.
3971 *(*)*: Returns the cloned value.
3975 var objects = [{ 'a': 1 }, { 'b': 2 }];
3977 var shallow = _.clone(objects);
3978 console.log(shallow[0] === objects[0]);
3987 ### <a id="_clonedeepvalue"></a>`_.cloneDeep(value)`
3988 <a href="#_clonedeepvalue">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L9463 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.clonedeep "See the npm package")
3990 This method is like `_.clone` except that it recursively clones `value`.
3993 1. `value` *(*)*: The value to recursively clone.
3996 *(*)*: Returns the deep cloned value.
4000 var objects = [{ 'a': 1 }, { 'b': 2 }];
4002 var deep = _.cloneDeep(objects);
4003 console.log(deep[0] === objects[0]);
4012 ### <a id="_clonedeepwithvalue-customizer"></a>`_.cloneDeepWith(value, [customizer])`
4013 <a href="#_clonedeepwithvalue-customizer">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L9493 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.clonedeepwith "See the npm package")
4015 This method is like `_.cloneWith` except that it recursively clones `value`.
4018 1. `value` *(*)*: The value to recursively clone.
4019 2. `[customizer]` *(Function)*: The function to customize cloning.
4022 *(*)*: Returns the deep cloned value.
4026 function customizer(value) {
4027 if (_.isElement(value)) {
4028 return value.cloneNode(true);
4032 var el = _.cloneDeepWith(document.body, customizer);
4034 console.log(el === document.body);
4036 console.log(el.nodeName);
4038 console.log(el.childNodes.length);
4047 ### <a id="_clonewithvalue-customizer"></a>`_.cloneWith(value, [customizer])`
4048 <a href="#_clonewithvalue-customizer">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L9443 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.clonewith "See the npm package")
4050 This method is like `_.clone` except that it accepts `customizer` which
4051 is invoked to produce the cloned value. If `customizer` returns `undefined`
4052 cloning is handled by the method instead. The `customizer` is invoked with
4053 up to four arguments; (value [, index|key, object, stack]).
4056 1. `value` *(*)*: The value to clone.
4057 2. `[customizer]` *(Function)*: The function to customize cloning.
4060 *(*)*: Returns the cloned value.
4064 function customizer(value) {
4065 if (_.isElement(value)) {
4066 return value.cloneNode(false);
4070 var el = _.cloneWith(document.body, customizer);
4072 console.log(el === document.body);
4074 console.log(el.nodeName);
4076 console.log(el.childNodes.length);
4085 ### <a id="_eqvalue-other"></a>`_.eq(value, other)`
4086 <a href="#_eqvalue-other">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L9527 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.eq "See the npm package")
4088 Performs a [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
4089 comparison between two values to determine if they are equivalent.
4092 1. `value` *(*)*: The value to compare.
4093 2. `other` *(*)*: The other value to compare.
4096 *(boolean)*: Returns `true` if the values are equivalent, else `false`.
4100 var object = { 'user': 'fred' };
4101 var other = { 'user': 'fred' };
4103 _.eq(object, object);
4106 _.eq(object, other);
4112 _.eq('a', Object('a'));
4124 ### <a id="_gtvalue-other"></a>`_.gt(value, other)`
4125 <a href="#_gtvalue-other">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L9551 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.gt "See the npm package")
4127 Checks if `value` is greater than `other`.
4130 1. `value` *(*)*: The value to compare.
4131 2. `other` *(*)*: The other value to compare.
4134 *(boolean)*: Returns `true` if `value` is greater than `other`, else `false`.
4153 ### <a id="_gtevalue-other"></a>`_.gte(value, other)`
4154 <a href="#_gtevalue-other">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L9575 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.gte "See the npm package")
4156 Checks if `value` is greater than or equal to `other`.
4159 1. `value` *(*)*: The value to compare.
4160 2. `other` *(*)*: The other value to compare.
4163 *(boolean)*: Returns `true` if `value` is greater than or equal to `other`, else `false`.
4182 ### <a id="_isargumentsvalue"></a>`_.isArguments(value)`
4183 <a href="#_isargumentsvalue">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L9595 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isarguments "See the npm package")
4185 Checks if `value` is likely an `arguments` object.
4188 1. `value` *(*)*: The value to check.
4191 *(boolean)*: Returns `true` if `value` is correctly classified, else `false`.
4195 _.isArguments(function() { return arguments; }());
4198 _.isArguments([1, 2, 3]);
4207 ### <a id="_isarrayvalue"></a>`_.isArray(value)`
4208 <a href="#_isarrayvalue">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L9624 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isarray "See the npm package")
4210 ({Function}): Checks if `value` is classified as an `Array` object.
4213 1. `value` *(*)*: The value to check.
4216 *(boolean)*: Returns `true` if `value` is correctly classified, else `false`.
4220 _.isArray([1, 2, 3]);
4223 _.isArray(document.body.children);
4238 ### <a id="_isarraybuffervalue"></a>`_.isArrayBuffer(value)`
4239 <a href="#_isarraybuffervalue">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L9642 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isarraybuffer "See the npm package")
4241 Checks if `value` is classified as an `ArrayBuffer` object.
4244 1. `value` *(*)*: The value to check.
4247 *(boolean)*: Returns `true` if `value` is correctly classified, else `false`.
4251 _.isArrayBuffer(new ArrayBuffer(2));
4254 _.isArrayBuffer(new Array(2));
4263 ### <a id="_isarraylikevalue"></a>`_.isArrayLike(value)`
4264 <a href="#_isarraylikevalue">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L9670 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isarraylike "See the npm package")
4266 Checks if `value` is array-like. A value is considered array-like if it's
4267 not a function and has a `value.length` that's an integer greater than or
4268 equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
4271 1. `value` *(*)*: The value to check.
4274 *(boolean)*: Returns `true` if `value` is array-like, else `false`.
4278 _.isArrayLike([1, 2, 3]);
4281 _.isArrayLike(document.body.children);
4284 _.isArrayLike('abc');
4287 _.isArrayLike(_.noop);
4296 ### <a id="_isarraylikeobjectvalue"></a>`_.isArrayLikeObject(value)`
4297 <a href="#_isarraylikeobjectvalue">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L9698 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isarraylikeobject "See the npm package")
4299 This method is like `_.isArrayLike` except that it also checks if `value`
4303 1. `value` *(*)*: The value to check.
4306 *(boolean)*: Returns `true` if `value` is an array-like object, else `false`.
4310 _.isArrayLikeObject([1, 2, 3]);
4313 _.isArrayLikeObject(document.body.children);
4316 _.isArrayLikeObject('abc');
4319 _.isArrayLikeObject(_.noop);
4328 ### <a id="_isbooleanvalue"></a>`_.isBoolean(value)`
4329 <a href="#_isbooleanvalue">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L9718 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isboolean "See the npm package")
4331 Checks if `value` is classified as a boolean primitive or object.
4334 1. `value` *(*)*: The value to check.
4337 *(boolean)*: Returns `true` if `value` is correctly classified, else `false`.
4353 ### <a id="_isbuffervalue"></a>`_.isBuffer(value)`
4354 <a href="#_isbuffervalue">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L9739 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isbuffer "See the npm package")
4356 Checks if `value` is a buffer.
4359 1. `value` *(*)*: The value to check.
4362 *(boolean)*: Returns `true` if `value` is a buffer, else `false`.
4366 _.isBuffer(new Buffer(2));
4369 _.isBuffer(new Uint8Array(2));
4378 ### <a id="_isdatevalue"></a>`_.isDate(value)`
4379 <a href="#_isdatevalue">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L9759 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isdate "See the npm package")
4381 Checks if `value` is classified as a `Date` object.
4384 1. `value` *(*)*: The value to check.
4387 *(boolean)*: Returns `true` if `value` is correctly classified, else `false`.
4394 _.isDate('Mon April 23 2012');
4403 ### <a id="_iselementvalue"></a>`_.isElement(value)`
4404 <a href="#_iselementvalue">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L9779 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.iselement "See the npm package")
4406 Checks if `value` is likely a DOM element.
4409 1. `value` *(*)*: The value to check.
4412 *(boolean)*: Returns `true` if `value` is a DOM element, else `false`.
4416 _.isElement(document.body);
4419 _.isElement('<body>');
4428 ### <a id="_isemptyvalue"></a>`_.isEmpty(value)`
4429 <a href="#_isemptyvalue">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L9810 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isempty "See the npm package")
4431 Checks if `value` is empty. A value is considered empty unless it's an
4432 `arguments` object, array, string, or jQuery-like collection with a length
4433 greater than `0` or an object with own enumerable properties.
4436 1. `value` *(Array|Object|string)*: The value to inspect.
4439 *(boolean)*: Returns `true` if `value` is empty, else `false`.
4452 _.isEmpty([1, 2, 3]);
4455 _.isEmpty({ 'a': 1 });
4464 ### <a id="_isequalvalue-other"></a>`_.isEqual(value, other)`
4465 <a href="#_isequalvalue-other">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L9851 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isequal "See the npm package")
4467 Performs a deep comparison between two values to determine if they are
4471 **Note:** This method supports comparing arrays, array buffers, booleans,
4472 date objects, error objects, maps, numbers, `Object` objects, regexes,
4473 sets, strings, symbols, and typed arrays. `Object` objects are compared
4474 by their own, not inherited, enumerable properties. Functions and DOM
4475 nodes are **not** supported.
4478 1. `value` *(*)*: The value to compare.
4479 2. `other` *(*)*: The other value to compare.
4482 *(boolean)*: Returns `true` if the values are equivalent, else `false`.
4486 var object = { 'user': 'fred' };
4487 var other = { 'user': 'fred' };
4489 _.isEqual(object, other);
4501 ### <a id="_isequalwithvalue-other-customizer"></a>`_.isEqualWith(value, other, [customizer])`
4502 <a href="#_isequalwithvalue-other-customizer">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L9886 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isequalwith "See the npm package")
4504 This method is like `_.isEqual` except that it accepts `customizer` which
4505 is invoked to compare values. If `customizer` returns `undefined` comparisons
4506 are handled by the method instead. The `customizer` is invoked with up to
4507 six arguments: (objValue, othValue [, index|key, object, other, stack]).
4510 1. `value` *(*)*: The value to compare.
4511 2. `other` *(*)*: The other value to compare.
4512 3. `[customizer]` *(Function)*: The function to customize comparisons.
4515 *(boolean)*: Returns `true` if the values are equivalent, else `false`.
4519 function isGreeting(value) {
4520 return /^h(?:i|ello)$/.test(value);
4523 function customizer(objValue, othValue) {
4524 if (isGreeting(objValue) && isGreeting(othValue)) {
4529 var array = ['hello', 'goodbye'];
4530 var other = ['hi', 'goodbye'];
4532 _.isEqualWith(array, other, customizer);
4541 ### <a id="_iserrorvalue"></a>`_.isError(value)`
4542 <a href="#_iserrorvalue">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L9909 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.iserror "See the npm package")
4544 Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,
4545 `SyntaxError`, `TypeError`, or `URIError` object.
4548 1. `value` *(*)*: The value to check.
4551 *(boolean)*: Returns `true` if `value` is an error object, else `false`.
4555 _.isError(new Error);
4567 ### <a id="_isfinitevalue"></a>`_.isFinite(value)`
4568 <a href="#_isfinitevalue">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L9941 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isfinite "See the npm package")
4570 Checks if `value` is a finite primitive number.
4573 **Note:** This method is based on [`Number.isFinite`](https://mdn.io/Number/isFinite).
4576 1. `value` *(*)*: The value to check.
4579 *(boolean)*: Returns `true` if `value` is a finite number, else `false`.
4586 _.isFinite(Number.MAX_VALUE);
4592 _.isFinite(Infinity);
4601 ### <a id="_isfunctionvalue"></a>`_.isFunction(value)`
4602 <a href="#_isfunctionvalue">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L9961 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isfunction "See the npm package")
4604 Checks if `value` is classified as a `Function` object.
4607 1. `value` *(*)*: The value to check.
4610 *(boolean)*: Returns `true` if `value` is correctly classified, else `false`.
4617 _.isFunction(/abc/);
4626 ### <a id="_isintegervalue"></a>`_.isInteger(value)`
4627 <a href="#_isintegervalue">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L9993 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isinteger "See the npm package")
4629 Checks if `value` is an integer.
4632 **Note:** This method is based on [`Number.isInteger`](https://mdn.io/Number/isInteger).
4635 1. `value` *(*)*: The value to check.
4638 *(boolean)*: Returns `true` if `value` is an integer, else `false`.
4645 _.isInteger(Number.MIN_VALUE);
4648 _.isInteger(Infinity);
4660 ### <a id="_islengthvalue"></a>`_.isLength(value)`
4661 <a href="#_islengthvalue">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L10021 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.islength "See the npm package")
4663 Checks if `value` is a valid array-like length.
4666 **Note:** This function is loosely based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength).
4669 1. `value` *(*)*: The value to check.
4672 *(boolean)*: Returns `true` if `value` is a valid length, else `false`.
4679 _.isLength(Number.MIN_VALUE);
4682 _.isLength(Infinity);
4694 ### <a id="_ismapvalue"></a>`_.isMap(value)`
4695 <a href="#_ismapvalue">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L10097 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.ismap "See the npm package")
4697 Checks if `value` is classified as a `Map` object.
4700 1. `value` *(*)*: The value to check.
4703 *(boolean)*: Returns `true` if `value` is correctly classified, else `false`.
4710 _.isMap(new WeakMap);
4719 ### <a id="_ismatchobject-source"></a>`_.isMatch(object, source)`
4720 <a href="#_ismatchobject-source">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L10124 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.ismatch "See the npm package")
4722 Performs a partial deep comparison between `object` and `source` to
4723 determine if `object` contains equivalent property values. This method is
4724 equivalent to a `_.matches` function when `source` is partially applied.
4727 **Note:** This method supports comparing the same values as `_.isEqual`.
4730 1. `object` *(Object)*: The object to inspect.
4731 2. `source` *(Object)*: The object of property values to match.
4734 *(boolean)*: Returns `true` if `object` is a match, else `false`.
4738 var object = { 'user': 'fred', 'age': 40 };
4740 _.isMatch(object, { 'age': 40 });
4743 _.isMatch(object, { 'age': 36 });
4752 ### <a id="_ismatchwithobject-source-customizer"></a>`_.isMatchWith(object, source, [customizer])`
4753 <a href="#_ismatchwithobject-source-customizer">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L10159 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.ismatchwith "See the npm package")
4755 This method is like `_.isMatch` except that it accepts `customizer` which
4756 is invoked to compare values. If `customizer` returns `undefined` comparisons
4757 are handled by the method instead. The `customizer` is invoked with five
4758 arguments: (objValue, srcValue, index|key, object, source).
4761 1. `object` *(Object)*: The object to inspect.
4762 2. `source` *(Object)*: The object of property values to match.
4763 3. `[customizer]` *(Function)*: The function to customize comparisons.
4766 *(boolean)*: Returns `true` if `object` is a match, else `false`.
4770 function isGreeting(value) {
4771 return /^h(?:i|ello)$/.test(value);
4774 function customizer(objValue, srcValue) {
4775 if (isGreeting(objValue) && isGreeting(srcValue)) {
4780 var object = { 'greeting': 'hello' };
4781 var source = { 'greeting': 'hi' };
4783 _.isMatchWith(object, source, customizer);
4792 ### <a id="_isnanvalue"></a>`_.isNaN(value)`
4793 <a href="#_isnanvalue">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L10189 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isnan "See the npm package")
4795 Checks if `value` is `NaN`.
4798 **Note:** This method is not the same as [`isNaN`](https://es5.github.io/#x15.1.2.4)
4799 which returns `true` for `undefined` and other non-numeric values.
4802 1. `value` *(*)*: The value to check.
4805 *(boolean)*: Returns `true` if `value` is `NaN`, else `false`.
4812 _.isNaN(new Number(NaN));
4827 ### <a id="_isnativevalue"></a>`_.isNative(value)`
4828 <a href="#_isnativevalue">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L10211 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isnative "See the npm package")
4830 Checks if `value` is a native function.
4833 1. `value` *(*)*: The value to check.
4836 *(boolean)*: Returns `true` if `value` is a native function, else `false`.
4840 _.isNative(Array.prototype.push);
4852 ### <a id="_isnilvalue"></a>`_.isNil(value)`
4853 <a href="#_isnilvalue">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L10261 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isnil "See the npm package")
4855 Checks if `value` is `null` or `undefined`.
4858 1. `value` *(*)*: The value to check.
4861 *(boolean)*: Returns `true` if `value` is nullish, else `false`.
4880 ### <a id="_isnullvalue"></a>`_.isNull(value)`
4881 <a href="#_isnullvalue">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L10238 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isnull "See the npm package")
4883 Checks if `value` is `null`.
4886 1. `value` *(*)*: The value to check.
4889 *(boolean)*: Returns `true` if `value` is `null`, else `false`.
4905 ### <a id="_isnumbervalue"></a>`_.isNumber(value)`
4906 <a href="#_isnumbervalue">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L10290 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isnumber "See the npm package")
4908 Checks if `value` is classified as a `Number` primitive or object.
4911 **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are classified
4912 as numbers, use the `_.isFinite` method.
4915 1. `value` *(*)*: The value to check.
4918 *(boolean)*: Returns `true` if `value` is correctly classified, else `false`.
4925 _.isNumber(Number.MIN_VALUE);
4928 _.isNumber(Infinity);
4940 ### <a id="_isobjectvalue"></a>`_.isObject(value)`
4941 <a href="#_isobjectvalue">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L10049 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isobject "See the npm package")
4943 Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`.
4944 (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
4947 1. `value` *(*)*: The value to check.
4950 *(boolean)*: Returns `true` if `value` is an object, else `false`.
4957 _.isObject([1, 2, 3]);
4972 ### <a id="_isobjectlikevalue"></a>`_.isObjectLike(value)`
4973 <a href="#_isobjectlikevalue">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L10077 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isobjectlike "See the npm package")
4975 Checks if `value` is object-like. A value is object-like if it's not `null`
4976 and has a `typeof` result of "object".
4979 1. `value` *(*)*: The value to check.
4982 *(boolean)*: Returns `true` if `value` is object-like, else `false`.
4989 _.isObjectLike([1, 2, 3]);
4992 _.isObjectLike(_.noop);
4995 _.isObjectLike(null);
5004 ### <a id="_isplainobjectvalue"></a>`_.isPlainObject(value)`
5005 <a href="#_isplainobjectvalue">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L10322 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isplainobject "See the npm package")
5007 Checks if `value` is a plain object, that is, an object created by the
5008 `Object` constructor or one with a `[[Prototype]]` of `null`.
5011 1. `value` *(*)*: The value to check.
5014 *(boolean)*: Returns `true` if `value` is a plain object, else `false`.
5022 _.isPlainObject(new Foo);
5025 _.isPlainObject([1, 2, 3]);
5028 _.isPlainObject({ 'x': 0, 'y': 0 });
5031 _.isPlainObject(Object.create(null));
5040 ### <a id="_isregexpvalue"></a>`_.isRegExp(value)`
5041 <a href="#_isregexpvalue">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L10352 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isregexp "See the npm package")
5043 Checks if `value` is classified as a `RegExp` object.
5046 1. `value` *(*)*: The value to check.
5049 *(boolean)*: Returns `true` if `value` is correctly classified, else `false`.
5056 _.isRegExp('/abc/');
5065 ### <a id="_issafeintegervalue"></a>`_.isSafeInteger(value)`
5066 <a href="#_issafeintegervalue">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L10381 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.issafeinteger "See the npm package")
5068 Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754
5069 double precision number which isn't the result of a rounded unsafe integer.
5072 **Note:** This method is based on [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger).
5075 1. `value` *(*)*: The value to check.
5078 *(boolean)*: Returns `true` if `value` is a safe integer, else `false`.
5085 _.isSafeInteger(Number.MIN_VALUE);
5088 _.isSafeInteger(Infinity);
5091 _.isSafeInteger('3');
5100 ### <a id="_issetvalue"></a>`_.isSet(value)`
5101 <a href="#_issetvalue">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L10401 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isset "See the npm package")
5103 Checks if `value` is classified as a `Set` object.
5106 1. `value` *(*)*: The value to check.
5109 *(boolean)*: Returns `true` if `value` is correctly classified, else `false`.
5116 _.isSet(new WeakSet);
5125 ### <a id="_isstringvalue"></a>`_.isString(value)`
5126 <a href="#_isstringvalue">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L10421 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isstring "See the npm package")
5128 Checks if `value` is classified as a `String` primitive or object.
5131 1. `value` *(*)*: The value to check.
5134 *(boolean)*: Returns `true` if `value` is correctly classified, else `false`.
5150 ### <a id="_issymbolvalue"></a>`_.isSymbol(value)`
5151 <a href="#_issymbolvalue">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L10442 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.issymbol "See the npm package")
5153 Checks if `value` is classified as a `Symbol` primitive or object.
5156 1. `value` *(*)*: The value to check.
5159 *(boolean)*: Returns `true` if `value` is correctly classified, else `false`.
5163 _.isSymbol(Symbol.iterator);
5175 ### <a id="_istypedarrayvalue"></a>`_.isTypedArray(value)`
5176 <a href="#_istypedarrayvalue">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L10463 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.istypedarray "See the npm package")
5178 Checks if `value` is classified as a typed array.
5181 1. `value` *(*)*: The value to check.
5184 *(boolean)*: Returns `true` if `value` is correctly classified, else `false`.
5188 _.isTypedArray(new Uint8Array);
5200 ### <a id="_isundefinedvalue"></a>`_.isUndefined(value)`
5201 <a href="#_isundefinedvalue">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L10484 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isundefined "See the npm package")
5203 Checks if `value` is `undefined`.
5206 1. `value` *(*)*: The value to check.
5209 *(boolean)*: Returns `true` if `value` is `undefined`, else `false`.
5213 _.isUndefined(void 0);
5216 _.isUndefined(null);
5225 ### <a id="_isweakmapvalue"></a>`_.isWeakMap(value)`
5226 <a href="#_isweakmapvalue">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L10504 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isweakmap "See the npm package")
5228 Checks if `value` is classified as a `WeakMap` object.
5231 1. `value` *(*)*: The value to check.
5234 *(boolean)*: Returns `true` if `value` is correctly classified, else `false`.
5238 _.isWeakMap(new WeakMap);
5241 _.isWeakMap(new Map);
5250 ### <a id="_isweaksetvalue"></a>`_.isWeakSet(value)`
5251 <a href="#_isweaksetvalue">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L10524 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isweakset "See the npm package")
5253 Checks if `value` is classified as a `WeakSet` object.
5256 1. `value` *(*)*: The value to check.
5259 *(boolean)*: Returns `true` if `value` is correctly classified, else `false`.
5263 _.isWeakSet(new WeakSet);
5266 _.isWeakSet(new Set);
5275 ### <a id="_ltvalue-other"></a>`_.lt(value, other)`
5276 <a href="#_ltvalue-other">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L10548 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.lt "See the npm package")
5278 Checks if `value` is less than `other`.
5281 1. `value` *(*)*: The value to compare.
5282 2. `other` *(*)*: The other value to compare.
5285 *(boolean)*: Returns `true` if `value` is less than `other`, else `false`.
5304 ### <a id="_ltevalue-other"></a>`_.lte(value, other)`
5305 <a href="#_ltevalue-other">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L10572 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.lte "See the npm package")
5307 Checks if `value` is less than or equal to `other`.
5310 1. `value` *(*)*: The value to compare.
5311 2. `other` *(*)*: The other value to compare.
5314 *(boolean)*: Returns `true` if `value` is less than or equal to `other`, else `false`.
5333 ### <a id="_toarrayvalue"></a>`_.toArray(value)`
5334 <a href="#_toarrayvalue">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L10598 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.toarray "See the npm package")
5336 Converts `value` to an array.
5339 1. `value` *(*)*: The value to convert.
5342 *(Array)*: Returns the converted array.
5346 _.toArray({ 'a': 1, 'b': 2 });
5350 // => ['a', 'b', 'c']
5364 ### <a id="_tointegervalue"></a>`_.toInteger(value)`
5365 <a href="#_tointegervalue">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L10638 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.tointeger "See the npm package")
5367 Converts `value` to an integer.
5370 **Note:** This function is loosely based on [`ToInteger`](http://www.ecma-international.org/ecma-262/6.0/#sec-tointeger).
5373 1. `value` *(*)*: The value to convert.
5376 *(number)*: Returns the converted integer.
5383 _.toInteger(Number.MIN_VALUE);
5386 _.toInteger(Infinity);
5387 // => 1.7976931348623157e+308
5398 ### <a id="_tolengthvalue"></a>`_.toLength(value)`
5399 <a href="#_tolengthvalue">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L10676 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.tolength "See the npm package")
5401 Converts `value` to an integer suitable for use as the length of an
5405 **Note:** This method is based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength).
5408 1. `value` *(*)*: The value to convert.
5411 *(number)*: Returns the converted integer.
5418 _.toLength(Number.MIN_VALUE);
5421 _.toLength(Infinity);
5433 ### <a id="_tonumbervalue"></a>`_.toNumber(value)`
5434 <a href="#_tonumbervalue">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L10702 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.tonumber "See the npm package")
5436 Converts `value` to a number.
5439 1. `value` *(*)*: The value to process.
5442 *(number)*: Returns the number.
5449 _.toNumber(Number.MIN_VALUE);
5452 _.toNumber(Infinity);
5464 ### <a id="_toplainobjectvalue"></a>`_.toPlainObject(value)`
5465 <a href="#_toplainobjectvalue">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L10740 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.toplainobject "See the npm package")
5467 Converts `value` to a plain object flattening inherited enumerable
5468 properties of `value` to own properties of the plain object.
5471 1. `value` *(*)*: The value to convert.
5474 *(Object)*: Returns the converted plain object.
5482 Foo.prototype.c = 3;
5484 _.assign({ 'a': 1 }, new Foo);
5485 // => { 'a': 1, 'b': 2 }
5487 _.assign({ 'a': 1 }, _.toPlainObject(new Foo));
5488 // => { 'a': 1, 'b': 2, 'c': 3 }
5496 ### <a id="_tosafeintegervalue"></a>`_.toSafeInteger(value)`
5497 <a href="#_tosafeintegervalue">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L10767 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.tosafeinteger "See the npm package")
5499 Converts `value` to a safe integer. A safe integer can be compared and
5500 represented correctly.
5503 1. `value` *(*)*: The value to convert.
5506 *(number)*: Returns the converted integer.
5513 _.toSafeInteger(Number.MIN_VALUE);
5516 _.toSafeInteger(Infinity);
5517 // => 9007199254740991
5519 _.toSafeInteger('3');
5528 ### <a id="_tostringvalue"></a>`_.toString(value)`
5529 <a href="#_tostringvalue">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L10791 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.tostring "See the npm package")
5531 Converts `value` to a string if it's not one. An empty string is returned
5532 for `null` and `undefined` values. The sign of `-0` is preserved.
5535 1. `value` *(*)*: The value to process.
5538 *(string)*: Returns the string.
5548 _.toString([1, 2, 3]);
5563 ### <a id="_addaugend-addend"></a>`_.add(augend, addend)`
5564 <a href="#_addaugend-addend">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L14054 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.add "See the npm package")
5569 1. `augend` *(number)*: The first number in an addition.
5570 2. `addend` *(number)*: The second number in an addition.
5573 *(number)*: Returns the total.
5586 ### <a id="_ceilnumber-precision0"></a>`_.ceil(number, [precision=0])`
5587 <a href="#_ceilnumber-precision0">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L14088 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.ceil "See the npm package")
5589 Computes `number` rounded up to `precision`.
5592 1. `number` *(number)*: The number to round up.
5593 2. `[precision=0]` *(number)*: The precision to round up to.
5596 *(number)*: Returns the rounded up number.
5615 ### <a id="_floornumber-precision0"></a>`_.floor(number, [precision=0])`
5616 <a href="#_floornumber-precision0">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L14110 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.floor "See the npm package")
5618 Computes `number` rounded down to `precision`.
5621 1. `number` *(number)*: The number to round down.
5622 2. `[precision=0]` *(number)*: The precision to round down to.
5625 *(number)*: Returns the rounded down number.
5644 ### <a id="_maxarray"></a>`_.max(array)`
5645 <a href="#_maxarray">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L14129 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.max "See the npm package")
5647 Computes the maximum value of `array`. If `array` is empty or falsey
5648 `undefined` is returned.
5651 1. `array` *(Array)*: The array to iterate over.
5654 *(*)*: Returns the maximum value.
5658 _.max([4, 2, 8, 6]);
5670 ### <a id="_maxbyarray-iteratee_identity"></a>`_.maxBy(array, [iteratee=_.identity])`
5671 <a href="#_maxbyarray-iteratee_identity">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L14157 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.maxby "See the npm package")
5673 This method is like `_.max` except that it accepts `iteratee` which is
5674 invoked for each element in `array` to generate the criterion by which
5675 the value is ranked. The iteratee is invoked with one argument: (value).
5678 1. `array` *(Array)*: The array to iterate over.
5679 2. `[iteratee=_.identity]` *(Function|Object|string)*: The iteratee invoked per element.
5682 *(*)*: Returns the maximum value.
5686 var objects = [{ 'n': 1 }, { 'n': 2 }];
5688 _.maxBy(objects, function(o) { return o.n; });
5691 // The `_.property` iteratee shorthand.
5692 _.maxBy(objects, 'n');
5701 ### <a id="_meanarray"></a>`_.mean(array)`
5702 <a href="#_meanarray">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L14176 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.mean "See the npm package")
5704 Computes the mean of the values in `array`.
5707 1. `array` *(Array)*: The array to iterate over.
5710 *(number)*: Returns the mean.
5714 _.mean([4, 2, 8, 6]);
5723 ### <a id="_minarray"></a>`_.min(array)`
5724 <a href="#_minarray">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L14197 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.min "See the npm package")
5726 Computes the minimum value of `array`. If `array` is empty or falsey
5727 `undefined` is returned.
5730 1. `array` *(Array)*: The array to iterate over.
5733 *(*)*: Returns the minimum value.
5737 _.min([4, 2, 8, 6]);
5749 ### <a id="_minbyarray-iteratee_identity"></a>`_.minBy(array, [iteratee=_.identity])`
5750 <a href="#_minbyarray-iteratee_identity">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L14225 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.minby "See the npm package")
5752 This method is like `_.min` except that it accepts `iteratee` which is
5753 invoked for each element in `array` to generate the criterion by which
5754 the value is ranked. The iteratee is invoked with one argument: (value).
5757 1. `array` *(Array)*: The array to iterate over.
5758 2. `[iteratee=_.identity]` *(Function|Object|string)*: The iteratee invoked per element.
5761 *(*)*: Returns the minimum value.
5765 var objects = [{ 'n': 1 }, { 'n': 2 }];
5767 _.minBy(objects, function(o) { return o.n; });
5770 // The `_.property` iteratee shorthand.
5771 _.minBy(objects, 'n');
5780 ### <a id="_roundnumber-precision0"></a>`_.round(number, [precision=0])`
5781 <a href="#_roundnumber-precision0">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L14251 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.round "See the npm package")
5783 Computes `number` rounded to `precision`.
5786 1. `number` *(number)*: The number to round.
5787 2. `[precision=0]` *(number)*: The precision to round to.
5790 *(number)*: Returns the rounded number.
5809 ### <a id="_subtractminuend-subtrahend"></a>`_.subtract(minuend, subtrahend)`
5810 <a href="#_subtractminuend-subtrahend">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L14267 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.subtract "See the npm package")
5812 Subtract two numbers.
5815 1. `minuend` *(number)*: The first number in a subtraction.
5816 2. `subtrahend` *(number)*: The second number in a subtraction.
5819 *(number)*: Returns the difference.
5832 ### <a id="_sumarray"></a>`_.sum(array)`
5833 <a href="#_sumarray">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L14294 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.sum "See the npm package")
5835 Computes the sum of the values in `array`.
5838 1. `array` *(Array)*: The array to iterate over.
5841 *(number)*: Returns the sum.
5845 _.sum([4, 2, 8, 6]);
5854 ### <a id="_sumbyarray-iteratee_identity"></a>`_.sumBy(array, [iteratee=_.identity])`
5855 <a href="#_sumbyarray-iteratee_identity">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L14322 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.sumby "See the npm package")
5857 This method is like `_.sum` except that it accepts `iteratee` which is
5858 invoked for each element in `array` to generate the value to be summed.
5859 The iteratee is invoked with one argument: (value).
5862 1. `array` *(Array)*: The array to iterate over.
5863 2. `[iteratee=_.identity]` *(Function|Object|string)*: The iteratee invoked per element.
5866 *(number)*: Returns the sum.
5870 var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
5872 _.sumBy(objects, function(o) { return o.n; });
5875 // The `_.property` iteratee shorthand.
5876 _.sumBy(objects, 'n');
5887 ## `“Number” Methods`
5891 ### <a id="_clampnumber-lower-upper"></a>`_.clamp(number, [lower], upper)`
5892 <a href="#_clampnumber-lower-upper">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L12074 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.clamp "See the npm package")
5894 Clamps `number` within the inclusive `lower` and `upper` bounds.
5897 1. `number` *(number)*: The number to clamp.
5898 2. `[lower]` *(number)*: The lower bound.
5899 3. `upper` *(number)*: The upper bound.
5902 *(number)*: Returns the clamped number.
5906 _.clamp(-10, -5, 5);
5918 ### <a id="_inrangenumber-start0-end"></a>`_.inRange(number, [start=0], end)`
5919 <a href="#_inrangenumber-start0-end">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L12126 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.inrange "See the npm package")
5921 Checks if `n` is between `start` and up to but not including, `end`. If
5922 `end` is not specified it's set to `start` with `start` then set to `0`.
5923 If `start` is greater than `end` the params are swapped to support
5927 1. `number` *(number)*: The number to check.
5928 2. `[start=0]` *(number)*: The start of the range.
5929 3. `end` *(number)*: The end of the range.
5932 *(boolean)*: Returns `true` if `number` is in the range, else `false`.
5954 _.inRange(-3, -2, -6);
5963 ### <a id="_randomlower0-upper1-floating"></a>`_.random([lower=0], [upper=1], [floating])`
5964 <a href="#_randomlower0-upper1-floating">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L12168 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.random "See the npm package")
5966 Produces a random number between the inclusive `lower` and `upper` bounds.
5967 If only one argument is provided a number between `0` and the given number
5968 is returned. If `floating` is `true`, or either `lower` or `upper` are floats,
5969 a floating-point number is returned instead of an integer.
5972 **Note:** JavaScript follows the IEEE-754 standard for resolving
5973 floating-point values which can produce unexpected results.
5976 1. `[lower=0]` *(number)*: The lower bound.
5977 2. `[upper=1]` *(number)*: The upper bound.
5978 3. `[floating]` *(boolean)*: Specify returning a floating-point number.
5981 *(number)*: Returns the random number.
5986 // => an integer between 0 and 5
5989 // => also an integer between 0 and 5
5992 // => a floating-point number between 0 and 5
5995 // => a floating-point number between 1.2 and 5.2
6005 ## `“Object” Methods`
6009 ### <a id="_assignobject-sources"></a>`_.assign(object, [sources])`
6010 <a href="#_assignobject-sources">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L10838 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.assign "See the npm package")
6012 Assigns own enumerable properties of source objects to the destination
6013 object. Source objects are applied from left to right. Subsequent sources
6014 overwrite property assignments of previous sources.
6017 **Note:** This method mutates `object` and is loosely based on
6018 [`Object.assign`](https://mdn.io/Object/assign).
6021 1. `object` *(Object)*: The destination object.
6022 2. `[sources]` *(...Object)*: The source objects.
6025 *(Object)*: Returns `object`.
6037 Foo.prototype.d = 4;
6038 Bar.prototype.f = 6;
6040 _.assign({ 'a': 1 }, new Foo, new Bar);
6041 // => { 'a': 1, 'c': 3, 'e': 5 }
6049 ### <a id="_assigninobject-sources"></a>`_.assignIn(object, [sources])`
6050 <a href="#_assigninobject-sources">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L10871 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.assignin "See the npm package")
6052 This method is like `_.assign` except that it iterates over own and
6053 inherited source properties.
6056 **Note:** This method mutates `object`.
6062 1. `object` *(Object)*: The destination object.
6063 2. `[sources]` *(...Object)*: The source objects.
6066 *(Object)*: Returns `object`.
6078 Foo.prototype.c = 3;
6079 Bar.prototype.e = 5;
6081 _.assignIn({ 'a': 1 }, new Foo, new Bar);
6082 // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5 }
6090 ### <a id="_assigninwithobject-sources-customizer"></a>`_.assignInWith(object, sources, [customizer])`
6091 <a href="#_assigninwithobject-sources-customizer">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L10902 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.assigninwith "See the npm package")
6093 This method is like `_.assignIn` except that it accepts `customizer` which
6094 is invoked to produce the assigned values. If `customizer` returns `undefined`
6095 assignment is handled by the method instead. The `customizer` is invoked
6096 with five arguments: (objValue, srcValue, key, object, source).
6099 **Note:** This method mutates `object`.
6105 1. `object` *(Object)*: The destination object.
6106 2. `sources` *(...Object)*: The source objects.
6107 3. `[customizer]` *(Function)*: The function to customize assigned values.
6110 *(Object)*: Returns `object`.
6114 function customizer(objValue, srcValue) {
6115 return _.isUndefined(objValue) ? srcValue : objValue;
6118 var defaults = _.partialRight(_.assignInWith, customizer);
6120 defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
6121 // => { 'a': 1, 'b': 2 }
6129 ### <a id="_assignwithobject-sources-customizer"></a>`_.assignWith(object, sources, [customizer])`
6130 <a href="#_assignwithobject-sources-customizer">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L10932 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.assignwith "See the npm package")
6132 This method is like `_.assign` except that it accepts `customizer` which
6133 is invoked to produce the assigned values. If `customizer` returns `undefined`
6134 assignment is handled by the method instead. The `customizer` is invoked
6135 with five arguments: (objValue, srcValue, key, object, source).
6138 **Note:** This method mutates `object`.
6141 1. `object` *(Object)*: The destination object.
6142 2. `sources` *(...Object)*: The source objects.
6143 3. `[customizer]` *(Function)*: The function to customize assigned values.
6146 *(Object)*: Returns `object`.
6150 function customizer(objValue, srcValue) {
6151 return _.isUndefined(objValue) ? srcValue : objValue;
6154 var defaults = _.partialRight(_.assignWith, customizer);
6156 defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
6157 // => { 'a': 1, 'b': 2 }
6165 ### <a id="_atobject-paths"></a>`_.at(object, [paths])`
6166 <a href="#_atobject-paths">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L10956 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.at "See the npm package")
6168 Creates an array of values corresponding to `paths` of `object`.
6171 1. `object` *(Object)*: The object to iterate over.
6172 2. `[paths]` *(...(string|string[])*: The property paths of elements to pick, specified individually or in arrays.
6175 *(Array)*: Returns the new array of picked elements.
6179 var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
6181 _.at(object, ['a[0].b.c', 'a[1]']);
6184 _.at(['a', 'b', 'c'], 0, 2);
6193 ### <a id="_createprototype-properties"></a>`_.create(prototype, [properties])`
6194 <a href="#_createprototype-properties">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L10992 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.create "See the npm package")
6196 Creates an object that inherits from the `prototype` object. If a `properties`
6197 object is given its own enumerable properties are assigned to the created object.
6200 1. `prototype` *(Object)*: The object to inherit from.
6201 2. `[properties]` *(Object)*: The properties to assign to the object.
6204 *(Object)*: Returns the new object.
6217 Circle.prototype = _.create(Shape.prototype, {
6218 'constructor': Circle
6221 var circle = new Circle;
6222 circle instanceof Circle;
6225 circle instanceof Shape;
6234 ### <a id="_defaultsobject-sources"></a>`_.defaults(object, [sources])`
6235 <a href="#_defaultsobject-sources">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L11016 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.defaults "See the npm package")
6237 Assigns own and inherited enumerable properties of source objects to the
6238 destination object for all destination properties that resolve to `undefined`.
6239 Source objects are applied from left to right. Once a property is set,
6240 additional values of the same property are ignored.
6243 **Note:** This method mutates `object`.
6246 1. `object` *(Object)*: The destination object.
6247 2. `[sources]` *(...Object)*: The source objects.
6250 *(Object)*: Returns `object`.
6254 _.defaults({ 'user': 'barney' }, { 'age': 36 }, { 'user': 'fred' });
6255 // => { 'user': 'barney', 'age': 36 }
6263 ### <a id="_defaultsdeepobject-sources"></a>`_.defaultsDeep(object, [sources])`
6264 <a href="#_defaultsdeepobject-sources">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L11039 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.defaultsdeep "See the npm package")
6266 This method is like `_.defaults` except that it recursively assigns
6270 **Note:** This method mutates `object`.
6273 1. `object` *(Object)*: The destination object.
6274 2. `[sources]` *(...Object)*: The source objects.
6277 *(Object)*: Returns `object`.
6281 _.defaultsDeep({ 'user': { 'name': 'barney' } }, { 'user': { 'name': 'fred', 'age': 36 } });
6282 // => { 'user': { 'name': 'barney', 'age': 36 } }
6290 ### <a id="_findkeyobject-predicate_identity"></a>`_.findKey(object, [predicate=_.identity])`
6291 <a href="#_findkeyobject-predicate_identity">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L11077 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.findkey "See the npm package")
6293 This method is like `_.find` except that it returns the key of the first
6294 element `predicate` returns truthy for instead of the element itself.
6297 1. `object` *(Object)*: The object to search.
6298 2. `[predicate=_.identity]` *(Function|Object|string)*: The function invoked per iteration.
6301 *(string|undefined)*: Returns the key of the matched element, else `undefined`.
6306 'barney': { 'age': 36, 'active': true },
6307 'fred': { 'age': 40, 'active': false },
6308 'pebbles': { 'age': 1, 'active': true }
6311 _.findKey(users, function(o) { return o.age < 40; });
6312 // => 'barney' (iteration order is not guaranteed)
6314 // The `_.matches` iteratee shorthand.
6315 _.findKey(users, { 'age': 1, 'active': true });
6318 // The `_.matchesProperty` iteratee shorthand.
6319 _.findKey(users, ['active', false]);
6322 // The `_.property` iteratee shorthand.
6323 _.findKey(users, 'active');
6332 ### <a id="_findlastkeyobject-predicate_identity"></a>`_.findLastKey(object, [predicate=_.identity])`
6333 <a href="#_findlastkeyobject-predicate_identity">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L11114 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.findlastkey "See the npm package")
6335 This method is like `_.findKey` except that it iterates over elements of
6336 a collection in the opposite order.
6339 1. `object` *(Object)*: The object to search.
6340 2. `[predicate=_.identity]` *(Function|Object|string)*: The function invoked per iteration.
6343 *(string|undefined)*: Returns the key of the matched element, else `undefined`.
6348 'barney': { 'age': 36, 'active': true },
6349 'fred': { 'age': 40, 'active': false },
6350 'pebbles': { 'age': 1, 'active': true }
6353 _.findLastKey(users, function(o) { return o.age < 40; });
6354 // => returns 'pebbles' assuming `_.findKey` returns 'barney'
6356 // The `_.matches` iteratee shorthand.
6357 _.findLastKey(users, { 'age': 36, 'active': true });
6360 // The `_.matchesProperty` iteratee shorthand.
6361 _.findLastKey(users, ['active', false]);
6364 // The `_.property` iteratee shorthand.
6365 _.findLastKey(users, 'active');
6374 ### <a id="_forinobject-iteratee_identity"></a>`_.forIn(object, [iteratee=_.identity])`
6375 <a href="#_forinobject-iteratee_identity">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L11144 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.forin "See the npm package")
6377 Iterates over own and inherited enumerable properties of an object invoking
6378 `iteratee` for each property. The iteratee is invoked with three arguments:<br>
6379 (value, key, object). Iteratee functions may exit iteration early by explicitly
6383 1. `object` *(Object)*: The object to iterate over.
6384 2. `[iteratee=_.identity]` *(Function)*: The function invoked per iteration.
6387 *(Object)*: Returns `object`.
6396 Foo.prototype.c = 3;
6398 _.forIn(new Foo, function(value, key) {
6401 // => logs 'a', 'b', then 'c' (iteration order is not guaranteed)
6409 ### <a id="_forinrightobject-iteratee_identity"></a>`_.forInRight(object, [iteratee=_.identity])`
6410 <a href="#_forinrightobject-iteratee_identity">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L11174 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.forinright "See the npm package")
6412 This method is like `_.forIn` except that it iterates over properties of
6413 `object` in the opposite order.
6416 1. `object` *(Object)*: The object to iterate over.
6417 2. `[iteratee=_.identity]` *(Function)*: The function invoked per iteration.
6420 *(Object)*: Returns `object`.
6429 Foo.prototype.c = 3;
6431 _.forInRight(new Foo, function(value, key) {
6434 // => logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'
6442 ### <a id="_forownobject-iteratee_identity"></a>`_.forOwn(object, [iteratee=_.identity])`
6443 <a href="#_forownobject-iteratee_identity">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L11206 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.forown "See the npm package")
6445 Iterates over own enumerable properties of an object invoking `iteratee`
6446 for each property. The iteratee is invoked with three arguments:<br>
6447 (value, key, object). Iteratee functions may exit iteration early by
6448 explicitly returning `false`.
6451 1. `object` *(Object)*: The object to iterate over.
6452 2. `[iteratee=_.identity]` *(Function)*: The function invoked per iteration.
6455 *(Object)*: Returns `object`.
6464 Foo.prototype.c = 3;
6466 _.forOwn(new Foo, function(value, key) {
6469 // => logs 'a' then 'b' (iteration order is not guaranteed)
6477 ### <a id="_forownrightobject-iteratee_identity"></a>`_.forOwnRight(object, [iteratee=_.identity])`
6478 <a href="#_forownrightobject-iteratee_identity">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L11234 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.forownright "See the npm package")
6480 This method is like `_.forOwn` except that it iterates over properties of
6481 `object` in the opposite order.
6484 1. `object` *(Object)*: The object to iterate over.
6485 2. `[iteratee=_.identity]` *(Function)*: The function invoked per iteration.
6488 *(Object)*: Returns `object`.
6497 Foo.prototype.c = 3;
6499 _.forOwnRight(new Foo, function(value, key) {
6502 // => logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'
6510 ### <a id="_functionsobject"></a>`_.functions(object)`
6511 <a href="#_functionsobject">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L11259 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.functions "See the npm package")
6513 Creates an array of function property names from own enumerable properties
6517 1. `object` *(Object)*: The object to inspect.
6520 *(Array)*: Returns the new array of property names.
6525 this.a = _.constant('a');
6526 this.b = _.constant('b');
6529 Foo.prototype.c = _.constant('c');
6531 _.functions(new Foo);
6540 ### <a id="_functionsinobject"></a>`_.functionsIn(object)`
6541 <a href="#_functionsinobject">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L11284 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.functionsin "See the npm package")
6543 Creates an array of function property names from own and inherited
6544 enumerable properties of `object`.
6547 1. `object` *(Object)*: The object to inspect.
6550 *(Array)*: Returns the new array of property names.
6555 this.a = _.constant('a');
6556 this.b = _.constant('b');
6559 Foo.prototype.c = _.constant('c');
6561 _.functionsIn(new Foo);
6562 // => ['a', 'b', 'c']
6570 ### <a id="_getobject-path-defaultvalue"></a>`_.get(object, path, [defaultValue])`
6571 <a href="#_getobject-path-defaultvalue">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L11312 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.get "See the npm package")
6573 Gets the value at `path` of `object`. If the resolved value is
6574 `undefined` the `defaultValue` is used in its place.
6577 1. `object` *(Object)*: The object to query.
6578 2. `path` *(Array|string)*: The path of the property to get.
6579 3. `[defaultValue]` *(*)*: The value returned if the resolved value is `undefined`.
6582 *(*)*: Returns the resolved value.
6586 var object = { 'a': [{ 'b': { 'c': 3 } }] };
6588 _.get(object, 'a[0].b.c');
6591 _.get(object, ['a', '0', 'b', 'c']);
6594 _.get(object, 'a.b.c', 'default');
6603 ### <a id="_hasobject-path"></a>`_.has(object, path)`
6604 <a href="#_hasobject-path">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L11343 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.has "See the npm package")
6606 Checks if `path` is a direct property of `object`.
6609 1. `object` *(Object)*: The object to query.
6610 2. `path` *(Array|string)*: The path to check.
6613 *(boolean)*: Returns `true` if `path` exists, else `false`.
6617 var object = { 'a': { 'b': { 'c': 3 } } };
6618 var other = _.create({ 'a': _.create({ 'b': _.create({ 'c': 3 }) }) });
6623 _.has(object, 'a.b.c');
6626 _.has(object, ['a', 'b', 'c']);
6638 ### <a id="_hasinobject-path"></a>`_.hasIn(object, path)`
6639 <a href="#_hasinobject-path">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L11372 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.hasin "See the npm package")
6641 Checks if `path` is a direct or inherited property of `object`.
6644 1. `object` *(Object)*: The object to query.
6645 2. `path` *(Array|string)*: The path to check.
6648 *(boolean)*: Returns `true` if `path` exists, else `false`.
6652 var object = _.create({ 'a': _.create({ 'b': _.create({ 'c': 3 }) }) });
6654 _.hasIn(object, 'a');
6657 _.hasIn(object, 'a.b.c');
6660 _.hasIn(object, ['a', 'b', 'c']);
6663 _.hasIn(object, 'b');
6672 ### <a id="_invertobject"></a>`_.invert(object)`
6673 <a href="#_invertobject">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L11393 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.invert "See the npm package")
6675 Creates an object composed of the inverted keys and values of `object`.
6676 If `object` contains duplicate values, subsequent values overwrite property
6677 assignments of previous values.
6680 1. `object` *(Object)*: The object to invert.
6683 *(Object)*: Returns the new inverted object.
6687 var object = { 'a': 1, 'b': 2, 'c': 1 };
6690 // => { '1': 'c', '2': 'b' }
6698 ### <a id="_invertbyobject-iteratee_identity"></a>`_.invertBy(object, [iteratee=_.identity])`
6699 <a href="#_invertbyobject-iteratee_identity">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L11422 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.invertby "See the npm package")
6701 This method is like `_.invert` except that the inverted object is generated
6702 from the results of running each element of `object` through `iteratee`.
6703 The corresponding inverted value of each inverted key is an array of keys
6704 responsible for generating the inverted value. The iteratee is invoked
6705 with one argument: (value).
6708 1. `object` *(Object)*: The object to invert.
6709 2. `[iteratee=_.identity]` *(Function|Object|string)*: The iteratee invoked per element.
6712 *(Object)*: Returns the new inverted object.
6716 var object = { 'a': 1, 'b': 2, 'c': 1 };
6719 // => { '1': ['a', 'c'], '2': ['b'] }
6721 _.invertBy(object, function(value) {
6722 return 'group' + value;
6724 // => { 'group1': ['a', 'c'], 'group2': ['b'] }
6732 ### <a id="_invokeobject-path-args"></a>`_.invoke(object, path, [args])`
6733 <a href="#_invokeobject-path-args">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L11447 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.invoke "See the npm package")
6735 Invokes the method at `path` of `object`.
6738 1. `object` *(Object)*: The object to query.
6739 2. `path` *(Array|string)*: The path of the method to invoke.
6740 3. `[args]` *(...*)*: The arguments to invoke the method with.
6743 *(*)*: Returns the result of the invoked method.
6747 var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] };
6749 _.invoke(object, 'a[0].b.c.slice', 1, 3);
6758 ### <a id="_keysobject"></a>`_.keys(object)`
6759 <a href="#_keysobject">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L11476 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.keys "See the npm package")
6761 Creates an array of the own enumerable property names of `object`.
6764 **Note:** Non-object values are coerced to objects. See the
6765 [ES spec](http://ecma-international.org/ecma-262/6.0/#sec-object.keys)
6769 1. `object` *(Object)*: The object to query.
6772 *(Array)*: Returns the array of property names.
6781 Foo.prototype.c = 3;
6784 // => ['a', 'b'] (iteration order is not guaranteed)
6795 ### <a id="_keysinobject"></a>`_.keysIn(object)`
6796 <a href="#_keysinobject">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L11518 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.keysin "See the npm package")
6798 Creates an array of the own and inherited enumerable property names of `object`.
6801 **Note:** Non-object values are coerced to objects.
6804 1. `object` *(Object)*: The object to query.
6807 *(Array)*: Returns the array of property names.
6816 Foo.prototype.c = 3;
6819 // => ['a', 'b', 'c'] (iteration order is not guaranteed)
6827 ### <a id="_mapkeysobject-iteratee_identity"></a>`_.mapKeys(object, [iteratee=_.identity])`
6828 <a href="#_mapkeysobject-iteratee_identity">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L11557 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.mapkeys "See the npm package")
6830 The opposite of `_.mapValues`; this method creates an object with the
6831 same values as `object` and keys generated by running each own enumerable
6832 property of `object` through `iteratee`. The iteratee is invoked with
6833 three arguments: (value, key, object).
6836 1. `object` *(Object)*: The object to iterate over.
6837 2. `[iteratee=_.identity]` *(Function|Object|string)*: The function invoked per iteration.
6840 *(Object)*: Returns the new mapped object.
6844 _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {
6847 // => { 'a1': 1, 'b2': 2 }
6855 ### <a id="_mapvaluesobject-iteratee_identity"></a>`_.mapValues(object, [iteratee=_.identity])`
6856 <a href="#_mapvaluesobject-iteratee_identity">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L11592 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.mapvalues "See the npm package")
6858 Creates an object with the same keys as `object` and values generated by
6859 running each own enumerable property of `object` through `iteratee`. The
6860 iteratee is invoked with three arguments: (value, key, object).
6863 1. `object` *(Object)*: The object to iterate over.
6864 2. `[iteratee=_.identity]` *(Function|Object|string)*: The function invoked per iteration.
6867 *(Object)*: Returns the new mapped object.
6872 'fred': { 'user': 'fred', 'age': 40 },
6873 'pebbles': { 'user': 'pebbles', 'age': 1 }
6876 _.mapValues(users, function(o) { return o.age; });
6877 // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
6879 // The `_.property` iteratee shorthand.
6880 _.mapValues(users, 'age');
6881 // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
6889 ### <a id="_mergeobject-sources"></a>`_.merge(object, [sources])`
6890 <a href="#_mergeobject-sources">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L11631 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.merge "See the npm package")
6892 Recursively merges own and inherited enumerable properties of source objects
6893 into the destination object. Source properties that resolve to `undefined`
6894 are skipped if a destination value exists. Array and plain object properties
6895 are merged recursively. Other objects and value types are overridden by
6896 assignment. Source objects are applied from left to right. Subsequent
6897 sources overwrite property assignments of previous sources.
6900 **Note:** This method mutates `object`.
6903 1. `object` *(Object)*: The destination object.
6904 2. `[sources]` *(...Object)*: The source objects.
6907 *(Object)*: Returns `object`.
6912 'data': [{ 'user': 'barney' }, { 'user': 'fred' }]
6916 'data': [{ 'age': 36 }, { 'age': 40 }]
6919 _.merge(users, ages);
6920 // => { 'data': [{ 'user': 'barney', 'age': 36 }, { 'user': 'fred', 'age': 40 }] }
6928 ### <a id="_mergewithobject-sources-customizer"></a>`_.mergeWith(object, sources, customizer)`
6929 <a href="#_mergewithobject-sources-customizer">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L11672 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.mergewith "See the npm package")
6931 This method is like `_.merge` except that it accepts `customizer` which
6932 is invoked to produce the merged values of the destination and source
6933 properties. If `customizer` returns `undefined` merging is handled by the
6934 method instead. The `customizer` is invoked with seven arguments:<br>
6935 (objValue, srcValue, key, object, source, stack).
6938 **Note:** This method mutates `object`.
6941 1. `object` *(Object)*: The destination object.
6942 2. `sources` *(...Object)*: The source objects.
6943 3. `customizer` *(Function)*: The function to customize assigned values.
6946 *(Object)*: Returns `object`.
6950 function customizer(objValue, srcValue) {
6951 if (_.isArray(objValue)) {
6952 return objValue.concat(srcValue);
6957 'fruits': ['apple'],
6958 'vegetables': ['beet']
6962 'fruits': ['banana'],
6963 'vegetables': ['carrot']
6966 _.mergeWith(object, other, customizer);
6967 // => { 'fruits': ['apple', 'banana'], 'vegetables': ['beet', 'carrot'] }
6975 ### <a id="_omitobject-props"></a>`_.omit(object, [props])`
6976 <a href="#_omitobject-props">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L11694 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.omit "See the npm package")
6978 The opposite of `_.pick`; this method creates an object composed of the
6979 own and inherited enumerable properties of `object` that are not omitted.
6982 1. `object` *(Object)*: The source object.
6983 2. `[props]` *(...(string|string[])*: The property names to omit, specified individually or in arrays.
6986 *(Object)*: Returns the new object.
6990 var object = { 'a': 1, 'b': '2', 'c': 3 };
6992 _.omit(object, ['a', 'c']);
7001 ### <a id="_omitbyobject-predicate_identity"></a>`_.omitBy(object, [predicate=_.identity])`
7002 <a href="#_omitbyobject-predicate_identity">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L11721 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.omitby "See the npm package")
7004 The opposite of `_.pickBy`; this method creates an object composed of
7005 the own and inherited enumerable properties of `object` that `predicate`
7006 doesn't return truthy for. The predicate is invoked with two arguments:<br>
7010 1. `object` *(Object)*: The source object.
7011 2. `[predicate=_.identity]` *(Function|Object|string)*: The function invoked per property.
7014 *(Object)*: Returns the new object.
7018 var object = { 'a': 1, 'b': '2', 'c': 3 };
7020 _.omitBy(object, _.isNumber);
7029 ### <a id="_pickobject-props"></a>`_.pick(object, [props])`
7030 <a href="#_pickobject-props">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L11745 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.pick "See the npm package")
7032 Creates an object composed of the picked `object` properties.
7035 1. `object` *(Object)*: The source object.
7036 2. `[props]` *(...(string|string[])*: The property names to pick, specified individually or in arrays.
7039 *(Object)*: Returns the new object.
7043 var object = { 'a': 1, 'b': '2', 'c': 3 };
7045 _.pick(object, ['a', 'c']);
7046 // => { 'a': 1, 'c': 3 }
7054 ### <a id="_pickbyobject-predicate_identity"></a>`_.pickBy(object, [predicate=_.identity])`
7055 <a href="#_pickbyobject-predicate_identity">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L11766 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.pickby "See the npm package")
7057 Creates an object composed of the `object` properties `predicate` returns
7058 truthy for. The predicate is invoked with two arguments: (value, key).
7061 1. `object` *(Object)*: The source object.
7062 2. `[predicate=_.identity]` *(Function|Object|string)*: The function invoked per property.
7065 *(Object)*: Returns the new object.
7069 var object = { 'a': 1, 'b': '2', 'c': 3 };
7071 _.pickBy(object, _.isNumber);
7072 // => { 'a': 1, 'c': 3 }
7080 ### <a id="_resultobject-path-defaultvalue"></a>`_.result(object, path, [defaultValue])`
7081 <a href="#_resultobject-path-defaultvalue">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L11798 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.result "See the npm package")
7083 This method is like `_.get` except that if the resolved value is a function
7084 it's invoked with the `this` binding of its parent object and its result
7088 1. `object` *(Object)*: The object to query.
7089 2. `path` *(Array|string)*: The path of the property to resolve.
7090 3. `[defaultValue]` *(*)*: The value returned if the resolved value is `undefined`.
7093 *(*)*: Returns the resolved value.
7097 var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };
7099 _.result(object, 'a[0].b.c1');
7102 _.result(object, 'a[0].b.c2');
7105 _.result(object, 'a[0].b.c3', 'default');
7108 _.result(object, 'a[0].b.c3', _.constant('default'));
7117 ### <a id="_setobject-path-value"></a>`_.set(object, path, value)`
7118 <a href="#_setobject-path-value">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L11839 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.set "See the npm package")
7120 Sets the value at `path` of `object`. If a portion of `path` doesn't exist
7121 it's created. Arrays are created for missing index properties while objects
7122 are created for all other missing properties. Use `_.setWith` to customize
7126 **Note:** This method mutates `object`.
7129 1. `object` *(Object)*: The object to modify.
7130 2. `path` *(Array|string)*: The path of the property to set.
7131 3. `value` *(*)*: The value to set.
7134 *(Object)*: Returns `object`.
7138 var object = { 'a': [{ 'b': { 'c': 3 } }] };
7140 _.set(object, 'a[0].b.c', 4);
7141 console.log(object.a[0].b.c);
7144 _.set(object, 'x[0].y.z', 5);
7145 console.log(object.x[0].y.z);
7154 ### <a id="_setwithobject-path-value-customizer"></a>`_.setWith(object, path, value, [customizer])`
7155 <a href="#_setwithobject-path-value-customizer">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L11864 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.setwith "See the npm package")
7157 This method is like `_.set` except that it accepts `customizer` which is
7158 invoked to produce the objects of `path`. If `customizer` returns `undefined`
7159 path creation is handled by the method instead. The `customizer` is invoked
7160 with three arguments: (nsValue, key, nsObject).
7163 **Note:** This method mutates `object`.
7166 1. `object` *(Object)*: The object to modify.
7167 2. `path` *(Array|string)*: The path of the property to set.
7168 3. `value` *(*)*: The value to set.
7169 4. `[customizer]` *(Function)*: The function to customize assigned values.
7172 *(Object)*: Returns `object`.
7176 _.setWith({ '0': { 'length': 2 } }, '[0][1][2]', 3, Object);
7177 // => { '0': { '1': { '2': 3 }, 'length': 2 } }
7185 ### <a id="_topairsobject"></a>`_.toPairs(object)`
7186 <a href="#_topairsobject">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L11890 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.topairs "See the npm package")
7188 Creates an array of own enumerable key-value pairs for `object` which
7189 can be consumed by `_.fromPairs`.
7192 1. `object` *(Object)*: The object to query.
7195 *(Array)*: Returns the new array of key-value pairs.
7204 Foo.prototype.c = 3;
7207 // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)
7215 ### <a id="_topairsinobject"></a>`_.toPairsIn(object)`
7216 <a href="#_topairsinobject">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L11915 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.topairsin "See the npm package")
7218 Creates an array of own and inherited enumerable key-value pairs for
7219 `object` which can be consumed by `_.fromPairs`.
7222 1. `object` *(Object)*: The object to query.
7225 *(Array)*: Returns the new array of key-value pairs.
7234 Foo.prototype.c = 3;
7236 _.toPairsIn(new Foo);
7237 // => [['a', 1], ['b', 2], ['c', 1]] (iteration order is not guaranteed)
7245 ### <a id="_transformobject-iteratee_identity-accumulator"></a>`_.transform(object, [iteratee=_.identity], [accumulator])`
7246 <a href="#_transformobject-iteratee_identity-accumulator">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L11947 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.transform "See the npm package")
7248 An alternative to `_.reduce`; this method transforms `object` to a new
7249 `accumulator` object which is the result of running each of its own enumerable
7250 properties through `iteratee`, with each invocation potentially mutating
7251 the `accumulator` object. The iteratee is invoked with four arguments:<br>
7252 (accumulator, value, key, object). Iteratee functions may exit iteration
7253 early by explicitly returning `false`.
7256 1. `object` *(Array|Object)*: The object to iterate over.
7257 2. `[iteratee=_.identity]` *(Function)*: The function invoked per iteration.
7258 3. `[accumulator]` *(*)*: The custom accumulator value.
7261 *(*)*: Returns the accumulated value.
7265 _.transform([2, 3, 4], function(result, n) {
7266 result.push(n *= n);
7271 _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
7272 (result[value] || (result[value] = [])).push(key);
7274 // => { '1': ['a', 'c'], '2': ['b'] }
7282 ### <a id="_unsetobject-path"></a>`_.unset(object, path)`
7283 <a href="#_unsetobject-path">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L11995 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.unset "See the npm package")
7285 Removes the property at `path` of `object`.
7288 **Note:** This method mutates `object`.
7291 1. `object` *(Object)*: The object to modify.
7292 2. `path` *(Array|string)*: The path of the property to unset.
7295 *(boolean)*: Returns `true` if the property is deleted, else `false`.
7299 var object = { 'a': [{ 'b': { 'c': 7 } }] };
7300 _.unset(object, 'a[0].b.c');
7303 console.log(object);
7304 // => { 'a': [{ 'b': {} }] };
7306 _.unset(object, 'a[0].b.c');
7309 console.log(object);
7310 // => { 'a': [{ 'b': {} }] };
7318 ### <a id="_valuesobject"></a>`_.values(object)`
7319 <a href="#_valuesobject">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L12024 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.values "See the npm package")
7321 Creates an array of the own enumerable property values of `object`.
7324 **Note:** Non-object values are coerced to objects.
7327 1. `object` *(Object)*: The object to query.
7330 *(Array)*: Returns the array of property values.
7339 Foo.prototype.c = 3;
7342 // => [1, 2] (iteration order is not guaranteed)
7353 ### <a id="_valuesinobject"></a>`_.valuesIn(object)`
7354 <a href="#_valuesinobject">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L12050 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.valuesin "See the npm package")
7356 Creates an array of the own and inherited enumerable property values of `object`.
7359 **Note:** Non-object values are coerced to objects.
7362 1. `object` *(Object)*: The object to query.
7365 *(Array)*: Returns the array of property values.
7374 Foo.prototype.c = 3;
7376 _.valuesIn(new Foo);
7377 // => [1, 2, 3] (iteration order is not guaranteed)
7391 ### <a id="_value"></a>`_(value)`
7392 <a href="#_value">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L1500 "View in source") [Ⓣ][1]
7394 Creates a `lodash` object which wraps `value` to enable implicit method
7395 chaining. Methods that operate on and return arrays, collections, and
7396 functions can be chained together. Methods that retrieve a single value or
7397 may return a primitive value will automatically end the chain sequence and
7398 return the unwrapped value. Otherwise, the value must be unwrapped with
7402 Explicit chaining, which must be unwrapped with `_#value` in all cases,
7403 may be enabled using `_.chain`.
7406 The execution of chained methods is lazy, that is, it's deferred until
7407 `_#value` is implicitly or explicitly called.
7410 Lazy evaluation allows several methods to support shortcut fusion. Shortcut
7411 fusion is an optimization to merge iteratee calls; this avoids the creation
7412 of intermediate arrays and can greatly reduce the number of iteratee executions.
7413 Sections of a chain sequence qualify for shortcut fusion if the section is
7414 applied to an array of at least two hundred elements and any iteratees
7415 accept only one argument. The heuristic for whether a section qualifies
7416 for shortcut fusion is subject to change.
7419 Chaining is supported in custom builds as long as the `_#value` method is
7420 directly or indirectly included in the build.
7423 In addition to lodash methods, wrappers have `Array` and `String` methods.
7426 The wrapper `Array` methods are:<br>
7427 `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`
7430 The wrapper `String` methods are:<br>
7431 `replace` and `split`
7434 The wrapper methods that support shortcut fusion are:<br>
7435 `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,
7436 `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,
7437 `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`
7440 The chainable wrapper methods are:<br>
7441 `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,
7442 `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,
7443 `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,
7444 `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`, `difference`,
7445 `differenceBy`, `differenceWith`, `drop`, `dropRight`, `dropRightWhile`,
7446 `dropWhile`, `fill`, `filter`, `flatten`, `flattenDeep`, `flattenDepth`,
7447 `flip`, `flow`, `flowRight`, `fromPairs`, `functions`, `functionsIn`,
7448 `groupBy`, `initial`, `intersection`, `intersectionBy`, `intersectionWith`,
7449 `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`, `keys`, `keysIn`,
7450 `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`, `memoize`,
7451 `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`, `nthArg`,
7452 `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`, `overEvery`,
7453 `overSome`, `partial`, `partialRight`, `partition`, `pick`, `pickBy`, `plant`,
7454 `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`, `pullAt`, `push`,
7455 `range`, `rangeRight`, `rearg`, `reject`, `remove`, `rest`, `reverse`,
7456 `sampleSize`, `set`, `setWith`, `shuffle`, `slice`, `sort`, `sortBy`,
7457 `splice`, `spread`, `tail`, `take`, `takeRight`, `takeRightWhile`,
7458 `takeWhile`, `tap`, `throttle`, `thru`, `toArray`, `toPairs`, `toPairsIn`,
7459 `toPath`, `toPlainObject`, `transform`, `unary`, `union`, `unionBy`,
7460 `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`, `unshift`, `unzip`,
7461 `unzipWith`, `values`, `valuesIn`, `without`, `wrap`, `xor`, `xorBy`,
7462 `xorWith`, `zip`, `zipObject`, `zipObjectDeep`, and `zipWith`
7465 The wrapper methods that are **not** chainable by default are:<br>
7466 `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,
7467 `cloneDeep`, `cloneDeepWith`, `cloneWith`, `deburr`, `endsWith`, `eq`,
7468 `escape`, `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`,
7469 `findLastIndex`, `findLastKey`, `floor`, `forEach`, `forEachRight`, `forIn`,
7470 `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`, `hasIn`,
7471 `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`, `isArguments`,
7472 `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`, `isBoolean`,
7473 `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`, `isEqualWith`,
7474 `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`, `isMap`,
7475 `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`, `isNumber`,
7476 `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`, `isSafeInteger`,
7477 `isSet`, `isString`, `isUndefined`, `isTypedArray`, `isWeakMap`, `isWeakSet`,
7478 `join`, `kebabCase`, `last`, `lastIndexOf`, `lowerCase`, `lowerFirst`,
7479 `lt`, `lte`, `max`, `maxBy`, `mean`, `min`, `minBy`, `noConflict`, `noop`,
7480 `now`, `pad`, `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`,
7481 `reduceRight`, `repeat`, `result`, `round`, `runInContext`, `sample`,
7482 `shift`, `size`, `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`,
7483 `sortedLastIndex`, `sortedLastIndexBy`, `startCase`, `startsWith`, `subtract`,
7484 `sum`, `sumBy`, `template`, `times`, `toLower`, `toInteger`, `toLength`,
7485 `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`, `trimEnd`,
7486 `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`, `upperFirst`,
7487 `value`, and `words`
7490 1. `value` *(*)*: The value to wrap in a `lodash` instance.
7493 *(Object)*: Returns the new `lodash` wrapper instance.
7497 function square(n) {
7501 var wrapped = _([1, 2, 3]);
7503 // Returns an unwrapped value.
7504 wrapped.reduce(_.add);
7507 // Returns a wrapped value.
7508 var squares = wrapped.map(square);
7513 _.isArray(squares.value());
7522 ### <a id="_chainvalue"></a>`_.chain(value)`
7523 <a href="#_chainvalue">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L7205 "View in source") [Ⓣ][1]
7525 Creates a `lodash` object that wraps `value` with explicit method chaining enabled.
7526 The result of such method chaining must be unwrapped with `_#value`.
7529 1. `value` *(*)*: The value to wrap.
7532 *(Object)*: Returns the new `lodash` wrapper instance.
7537 { 'user': 'barney', 'age': 36 },
7538 { 'user': 'fred', 'age': 40 },
7539 { 'user': 'pebbles', 'age': 1 }
7546 return o.user + ' is ' + o.age;
7550 // => 'pebbles is 1'
7558 ### <a id="_tapvalue-interceptor"></a>`_.tap(value, interceptor)`
7559 <a href="#_tapvalue-interceptor">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L7233 "View in source") [Ⓣ][1]
7561 This method invokes `interceptor` and returns `value`. The interceptor
7562 is invoked with one argument; (value). The purpose of this method is to
7563 "tap into" a method chain in order to modify intermediate results.
7566 1. `value` *(*)*: The value to provide to `interceptor`.
7567 2. `interceptor` *(Function)*: The function to invoke.
7570 *(*)*: Returns `value`.
7575 .tap(function(array) {
7576 // Mutate input array.
7589 ### <a id="_thruvalue-interceptor"></a>`_.thru(value, interceptor)`
7590 <a href="#_thruvalue-interceptor">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L7260 "View in source") [Ⓣ][1]
7592 This method is like `_.tap` except that it returns the result of `interceptor`.
7593 The purpose of this method is to "pass thru" values replacing intermediate
7594 results in a method chain.
7597 1. `value` *(*)*: The value to provide to `interceptor`.
7598 2. `interceptor` *(Function)*: The function to invoke.
7601 *(*)*: Returns the result of `interceptor`.
7608 .thru(function(value) {
7620 ### <a id="_prototypesymboliterator"></a>`_.prototype[Symbol.iterator]()`
7621 <a href="#_prototypesymboliterator">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L7436 "View in source") [Ⓣ][1]
7623 Enables the wrapper to be iterable.
7626 *(Object)*: Returns the wrapper object.
7630 var wrapped = _([1, 2]);
7632 wrapped[Symbol.iterator]() === wrapped;
7635 Array.from(wrapped);
7644 ### <a id="_prototypeatpaths"></a>`_.prototype.at([paths])`
7645 <a href="#_prototypeatpaths">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L7283 "View in source") [Ⓣ][1]
7647 This method is the wrapper version of `_.at`.
7650 1. `[paths]` *(...(string|string[])*: The property paths of elements to pick, specified individually or in arrays.
7653 *(Object)*: Returns the new `lodash` wrapper instance.
7657 var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
7659 _(object).at(['a[0].b.c', 'a[1]']).value();
7662 _(['a', 'b', 'c']).at(0, 2).value();
7671 ### <a id="_prototypechain"></a>`_.prototype.chain()`
7672 <a href="#_prototypechain">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L7334 "View in source") [Ⓣ][1]
7674 Enables explicit method chaining on the wrapper object.
7677 *(Object)*: Returns the new `lodash` wrapper instance.
7682 { 'user': 'barney', 'age': 36 },
7683 { 'user': 'fred', 'age': 40 }
7686 // A sequence without explicit chaining.
7688 // => { 'user': 'barney', 'age': 36 }
7690 // A sequence with explicit chaining.
7696 // => { 'user': 'barney' }
7704 ### <a id="_prototypecommit"></a>`_.prototype.commit()`
7705 <a href="#_prototypecommit">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L7363 "View in source") [Ⓣ][1]
7707 Executes the chained sequence and returns the wrapped result.
7710 *(Object)*: Returns the new `lodash` wrapper instance.
7715 var wrapped = _(array).push(3);
7720 wrapped = wrapped.commit();
7736 ### <a id="_prototypeflatmapiteratee_identity"></a>`_.prototype.flatMap([iteratee=_.identity])`
7737 <a href="#_prototypeflatmapiteratee_identity">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L7384 "View in source") [Ⓣ][1]
7739 This method is the wrapper version of `_.flatMap`.
7742 1. `[iteratee=_.identity]` *(Function|Object|string)*: The function invoked per iteration.
7745 *(Object)*: Returns the new `lodash` wrapper instance.
7749 function duplicate(n) {
7753 _([1, 2]).flatMap(duplicate).value();
7762 ### <a id="_prototypenext"></a>`_.prototype.next()`
7763 <a href="#_prototypenext">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L7409 "View in source") [Ⓣ][1]
7765 Gets the next value on a wrapped object following the
7766 [iterator protocol](https://mdn.io/iteration_protocols#iterator).
7769 *(Object)*: Returns the next iterator value.
7773 var wrapped = _([1, 2]);
7776 // => { 'done': false, 'value': 1 }
7779 // => { 'done': false, 'value': 2 }
7782 // => { 'done': true, 'value': undefined }
7790 ### <a id="_prototypeplantvalue"></a>`_.prototype.plant(value)`
7791 <a href="#_prototypeplantvalue">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L7463 "View in source") [Ⓣ][1]
7793 Creates a clone of the chained sequence planting `value` as the wrapped value.
7796 1. `value` *(*)*: The value to plant.
7799 *(Object)*: Returns the new `lodash` wrapper instance.
7803 function square(n) {
7807 var wrapped = _([1, 2]).map(square);
7808 var other = wrapped.plant([3, 4]);
7822 ### <a id="_prototypereverse"></a>`_.prototype.reverse()`
7823 <a href="#_prototypereverse">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L7502 "View in source") [Ⓣ][1]
7825 This method is the wrapper version of `_.reverse`.
7828 **Note:** This method mutates the wrapped array.
7831 *(Object)*: Returns the new `lodash` wrapper instance.
7835 var array = [1, 2, 3];
7837 _(array).reverse().value()
7849 ### <a id="_prototypevalue"></a>`_.prototype.value()`
7850 <a href="#_prototypevalue">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L7533 "View in source") [Ⓣ][1]
7852 Executes the chained sequence to extract the unwrapped value.
7855 *_.prototype.toJSON, _.prototype.valueOf*
7858 *(*)*: Returns the resolved unwrapped value.
7862 _([1, 2, 3]).value();
7873 ## `“String” Methods`
7877 ### <a id="_camelcasestring"></a>`_.camelCase([string=''])`
7878 <a href="#_camelcasestring">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L12228 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.camelcase "See the npm package")
7880 Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).
7883 1. `[string='']` *(string)*: The string to convert.
7886 *(string)*: Returns the camel cased string.
7890 _.camelCase('Foo Bar');
7893 _.camelCase('--foo-bar');
7896 _.camelCase('__foo_bar__');
7905 ### <a id="_capitalizestring"></a>`_.capitalize([string=''])`
7906 <a href="#_capitalizestring">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L12247 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.capitalize "See the npm package")
7908 Converts the first character of `string` to upper case and the remaining
7912 1. `[string='']` *(string)*: The string to capitalize.
7915 *(string)*: Returns the capitalized string.
7919 _.capitalize('FRED');
7928 ### <a id="_deburrstring"></a>`_.deburr([string=''])`
7929 <a href="#_deburrstring">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L12265 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.deburr "See the npm package")
7931 Deburrs `string` by converting [latin-1 supplementary letters](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)
7932 to basic latin letters and removing [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
7935 1. `[string='']` *(string)*: The string to deburr.
7938 *(string)*: Returns the deburred string.
7942 _.deburr('déjà vu');
7951 ### <a id="_endswithstring-target-positionstringlength"></a>`_.endsWith([string=''], [target], [position=string.length])`
7952 <a href="#_endswithstring-target-positionstringlength">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L12291 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.endswith "See the npm package")
7954 Checks if `string` ends with the given target string.
7957 1. `[string='']` *(string)*: The string to search.
7958 2. `[target]` *(string)*: The string to search for.
7959 3. `[position=string.length]` *(number)*: The position to search from.
7962 *(boolean)*: Returns `true` if `string` ends with `target`, else `false`.
7966 _.endsWith('abc', 'c');
7969 _.endsWith('abc', 'b');
7972 _.endsWith('abc', 'b', 2);
7981 ### <a id="_escapestring"></a>`_.escape([string=''])`
7982 <a href="#_escapestring">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L12336 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.escape "See the npm package")
7984 Converts the characters "&", "<", ">", '"', "'", and "\`" in `string` to
7985 their corresponding HTML entities.
7988 **Note:** No other characters are escaped. To escape additional
7989 characters use a third-party library like [_he_](https://mths.be/he).
7992 Though the ">" character is escaped for symmetry, characters like
7993 ">" and "/" don't need escaping in HTML and have no special meaning
7994 unless they're part of a tag or unquoted attribute value.
7995 See [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)
7996 (under "semi-related fun fact") for more details.
7999 Backticks are escaped because in IE < 9, they can break out of
8000 attribute values or HTML comments. See [#59](https://html5sec.org/#59),
8001 [#102](https://html5sec.org/#102), [#108](https://html5sec.org/#108), and
8002 [#133](https://html5sec.org/#133) of the [HTML5 Security Cheatsheet](https://html5sec.org/)
8006 When working with HTML you should always [quote attribute values](http://wonko.com/post/html-escaping)
8007 to reduce XSS vectors.
8010 1. `[string='']` *(string)*: The string to escape.
8013 *(string)*: Returns the escaped string.
8017 _.escape('fred, barney, & pebbles');
8018 // => 'fred, barney, & pebbles'
8026 ### <a id="_escaperegexpstring"></a>`_.escapeRegExp([string=''])`
8027 <a href="#_escaperegexpstring">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L12357 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.escaperegexp "See the npm package")
8029 Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+",
8030 "?", "(", ")", "[", "]", "{", "}", and "|" in `string`.
8033 1. `[string='']` *(string)*: The string to escape.
8036 *(string)*: Returns the escaped string.
8040 _.escapeRegExp('[lodash](https://lodash.com/)');
8041 // => '\[lodash\]\(https://lodash\.com/\)'
8049 ### <a id="_kebabcasestring"></a>`_.kebabCase([string=''])`
8050 <a href="#_kebabcasestring">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L12383 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.kebabcase "See the npm package")
8052 Converts `string` to [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).
8055 1. `[string='']` *(string)*: The string to convert.
8058 *(string)*: Returns the kebab cased string.
8062 _.kebabCase('Foo Bar');
8065 _.kebabCase('fooBar');
8068 _.kebabCase('__foo_bar__');
8077 ### <a id="_lowercasestring"></a>`_.lowerCase([string=''])`
8078 <a href="#_lowercasestring">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L12406 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.lowercase "See the npm package")
8080 Converts `string`, as space separated words, to lower case.
8083 1. `[string='']` *(string)*: The string to convert.
8086 *(string)*: Returns the lower cased string.
8090 _.lowerCase('--Foo-Bar');
8093 _.lowerCase('fooBar');
8096 _.lowerCase('__FOO_BAR__');
8105 ### <a id="_lowerfirststring"></a>`_.lowerFirst([string=''])`
8106 <a href="#_lowerfirststring">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L12426 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.lowerfirst "See the npm package")
8108 Converts the first character of `string` to lower case.
8111 1. `[string='']` *(string)*: The string to convert.
8114 *(string)*: Returns the converted string.
8118 _.lowerFirst('Fred');
8121 _.lowerFirst('FRED');
8130 ### <a id="_padstring-length0-chars"></a>`_.pad([string=''], [length=0], [chars=' '])`
8131 <a href="#_padstring-length0-chars">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L12468 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.pad "See the npm package")
8133 Pads `string` on the left and right sides if it's shorter than `length`.
8134 Padding characters are truncated if they can't be evenly divided by `length`.
8137 1. `[string='']` *(string)*: The string to pad.
8138 2. `[length=0]` *(number)*: The padding length.
8139 3. `[chars=' ']` *(string)*: The string used as padding.
8142 *(string)*: Returns the padded string.
8149 _.pad('abc', 8, '_-');
8161 ### <a id="_padendstring-length0-chars"></a>`_.padEnd([string=''], [length=0], [chars=' '])`
8162 <a href="#_padendstring-length0-chars">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L12505 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.padend "See the npm package")
8164 Pads `string` on the right side if it's shorter than `length`. Padding
8165 characters are truncated if they exceed `length`.
8168 1. `[string='']` *(string)*: The string to pad.
8169 2. `[length=0]` *(number)*: The padding length.
8170 3. `[chars=' ']` *(string)*: The string used as padding.
8173 *(string)*: Returns the padded string.
8180 _.padEnd('abc', 6, '_-');
8192 ### <a id="_padstartstring-length0-chars"></a>`_.padStart([string=''], [length=0], [chars=' '])`
8193 <a href="#_padstartstring-length0-chars">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L12532 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.padstart "See the npm package")
8195 Pads `string` on the left side if it's shorter than `length`. Padding
8196 characters are truncated if they exceed `length`.
8199 1. `[string='']` *(string)*: The string to pad.
8200 2. `[length=0]` *(number)*: The padding length.
8201 3. `[chars=' ']` *(string)*: The string used as padding.
8204 *(string)*: Returns the padded string.
8208 _.padStart('abc', 6);
8211 _.padStart('abc', 6, '_-');
8214 _.padStart('abc', 3);
8223 ### <a id="_parseintstring-radix10"></a>`_.parseInt(string, [radix=10])`
8224 <a href="#_parseintstring-radix10">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L12560 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.parseint "See the npm package")
8226 Converts `string` to an integer of the specified radix. If `radix` is
8227 `undefined` or `0`, a `radix` of `10` is used unless `value` is a hexadecimal,
8228 in which case a `radix` of `16` is used.
8231 **Note:** This method aligns with the [ES5 implementation](https://es5.github.io/#x15.1.2.2)
8235 1. `string` *(string)*: The string to convert.
8236 2. `[radix=10]` *(number)*: The radix to interpret `value` by.
8239 *(number)*: Returns the converted integer.
8246 _.map(['6', '08', '10'], _.parseInt);
8255 ### <a id="_repeatstring-n0"></a>`_.repeat([string=''], [n=0])`
8256 <a href="#_repeatstring-n0">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L12592 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.repeat "See the npm package")
8258 Repeats the given string `n` times.
8261 1. `[string='']` *(string)*: The string to repeat.
8262 2. `[n=0]` *(number)*: The number of times to repeat the string.
8265 *(string)*: Returns the repeated string.
8284 ### <a id="_replacestring-pattern-replacement"></a>`_.replace([string=''], pattern, replacement)`
8285 <a href="#_replacestring-pattern-replacement">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L12630 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.replace "See the npm package")
8287 Replaces matches for `pattern` in `string` with `replacement`.
8290 **Note:** This method is based on [`String#replace`](https://mdn.io/String/replace).
8293 1. `[string='']` *(string)*: The string to modify.
8294 2. `pattern` *(RegExp|string)*: The pattern to replace.
8295 3. `replacement` *(Function|string)*: The match replacement.
8298 *(string)*: Returns the modified string.
8302 _.replace('Hi Fred', 'Fred', 'Barney');
8311 ### <a id="_snakecasestring"></a>`_.snakeCase([string=''])`
8312 <a href="#_snakecasestring">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L12656 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.snakecase "See the npm package")
8314 Converts `string` to [snake case](https://en.wikipedia.org/wiki/Snake_case).
8317 1. `[string='']` *(string)*: The string to convert.
8320 *(string)*: Returns the snake cased string.
8324 _.snakeCase('Foo Bar');
8327 _.snakeCase('fooBar');
8330 _.snakeCase('--foo-bar');
8339 ### <a id="_splitstring-separator-limit"></a>`_.split([string=''], separator, [limit])`
8340 <a href="#_splitstring-separator-limit">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L12677 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.split "See the npm package")
8342 Splits `string` by `separator`.
8345 **Note:** This method is based on [`String#split`](https://mdn.io/String/split).
8348 1. `[string='']` *(string)*: The string to split.
8349 2. `separator` *(RegExp|string)*: The separator pattern to split by.
8350 3. `[limit]` *(number)*: The length to truncate results to.
8353 *(Array)*: Returns the new array of string segments.
8357 _.split('a-b-c', '-', 2);
8366 ### <a id="_startcasestring"></a>`_.startCase([string=''])`
8367 <a href="#_startcasestring">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L12700 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.startcase "See the npm package")
8369 Converts `string` to [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).
8372 1. `[string='']` *(string)*: The string to convert.
8375 *(string)*: Returns the start cased string.
8379 _.startCase('--foo-bar');
8382 _.startCase('fooBar');
8385 _.startCase('__foo_bar__');
8394 ### <a id="_startswithstring-target-position0"></a>`_.startsWith([string=''], [target], [position=0])`
8395 <a href="#_startswithstring-target-position0">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L12725 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.startswith "See the npm package")
8397 Checks if `string` starts with the given target string.
8400 1. `[string='']` *(string)*: The string to search.
8401 2. `[target]` *(string)*: The string to search for.
8402 3. `[position=0]` *(number)*: The position to search from.
8405 *(boolean)*: Returns `true` if `string` starts with `target`, else `false`.
8409 _.startsWith('abc', 'a');
8412 _.startsWith('abc', 'b');
8415 _.startsWith('abc', 'b', 1);
8424 ### <a id="_templatestring-options"></a>`_.template([string=''], [options])`
8425 <a href="#_templatestring-options">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L12827 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.template "See the npm package")
8427 Creates a compiled template function that can interpolate data properties
8428 in "interpolate" delimiters, HTML-escape interpolated data properties in
8429 "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data
8430 properties may be accessed as free variables in the template. If a setting
8431 object is given it takes precedence over `_.templateSettings` values.
8434 **Note:** In the development build `_.template` utilizes
8435 [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)
8436 for easier debugging.
8439 For more information on precompiling templates see
8440 [lodash's custom builds documentation](https://lodash.com/custom-builds).
8443 For more information on Chrome extension sandboxes see
8444 [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).
8447 1. `[string='']` *(string)*: The template string.
8448 2. `[options]` *(Object)*: The options object.
8449 3. `[options.escape]` *(RegExp)*: The HTML "escape" delimiter.
8450 4. `[options.evaluate]` *(RegExp)*: The "evaluate" delimiter.
8451 5. `[options.imports]` *(Object)*: An object to import into the template as free variables.
8452 6. `[options.interpolate]` *(RegExp)*: The "interpolate" delimiter.
8453 7. `[options.sourceURL]` *(string)*: The sourceURL of the template's compiled source.
8454 8. `[options.variable]` *(string)*: The data object variable name.
8457 *(Function)*: Returns the compiled template function.
8461 // Use the "interpolate" delimiter to create a compiled template.
8462 var compiled = _.template('hello <%= user %>!');
8463 compiled({ 'user': 'fred' });
8466 // Use the HTML "escape" delimiter to escape data property values.
8467 var compiled = _.template('<b><%- value %></b>');
8468 compiled({ 'value': '<script>' });
8469 // => '<b><script></b>'
8471 // Use the "evaluate" delimiter to execute JavaScript and generate HTML.
8472 var compiled = _.template('<% _.forEach(users, function(user) { %><li><%- user %></li><% }); %>');
8473 compiled({ 'users': ['fred', 'barney'] });
8474 // => '<li>fred</li><li>barney</li>'
8476 // Use the internal `print` function in "evaluate" delimiters.
8477 var compiled = _.template('<% print("hello " + user); %>!');
8478 compiled({ 'user': 'barney' });
8479 // => 'hello barney!'
8481 // Use the ES delimiter as an alternative to the default "interpolate" delimiter.
8482 var compiled = _.template('hello ${ user }!');
8483 compiled({ 'user': 'pebbles' });
8484 // => 'hello pebbles!'
8486 // Use custom template delimiters.
8487 _.templateSettings.interpolate = /{{([\s\S]+?)}}/g;
8488 var compiled = _.template('hello {{ user }}!');
8489 compiled({ 'user': 'mustache' });
8490 // => 'hello mustache!'
8492 // Use backslashes to treat delimiters as plain text.
8493 var compiled = _.template('<%= "\\<%- value %\\>" %>');
8494 compiled({ 'value': 'ignored' });
8495 // => '<%- value %>'
8497 // Use the `imports` option to import `jQuery` as `jq`.
8498 var text = '<% jq.each(users, function(user) { %><li><%- user %></li><% }); %>';
8499 var compiled = _.template(text, { 'imports': { 'jq': jQuery } });
8500 compiled({ 'users': ['fred', 'barney'] });
8501 // => '<li>fred</li><li>barney</li>'
8503 // Use the `sourceURL` option to specify a custom sourceURL for the template.
8504 var compiled = _.template('hello <%= user %>!', { 'sourceURL': '/basic/greeting.jst' });
8506 // => find the source of "greeting.jst" under the Sources tab or Resources panel of the web inspector
8508 // Use the `variable` option to ensure a with-statement isn't used in the compiled template.
8509 var compiled = _.template('hi <%= data.user %>!', { 'variable': 'data' });
8511 // => function(data) {
8512 // var __t, __p = '';
8513 // __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!';
8517 // Use the `source` property to inline compiled templates for meaningful
8518 // line numbers in error messages and stack traces.
8519 fs.writeFileSync(path.join(cwd, 'jst.js'), '\
8521 "main": ' + _.template(mainText).source + '\
8531 ### <a id="_tolowerstring"></a>`_.toLower([string=''])`
8532 <a href="#_tolowerstring">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L12953 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.tolower "See the npm package")
8534 Converts `string`, as a whole, to lower case.
8537 1. `[string='']` *(string)*: The string to convert.
8540 *(string)*: Returns the lower cased string.
8544 _.toLower('--Foo-Bar');
8547 _.toLower('fooBar');
8550 _.toLower('__FOO_BAR__');
8559 ### <a id="_toupperstring"></a>`_.toUpper([string=''])`
8560 <a href="#_toupperstring">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L12976 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.toupper "See the npm package")
8562 Converts `string`, as a whole, to upper case.
8565 1. `[string='']` *(string)*: The string to convert.
8568 *(string)*: Returns the upper cased string.
8572 _.toUpper('--foo-bar');
8575 _.toUpper('fooBar');
8578 _.toUpper('__foo_bar__');
8587 ### <a id="_trimstring-charswhitespace"></a>`_.trim([string=''], [chars=whitespace])`
8588 <a href="#_trimstring-charswhitespace">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L13001 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.trim "See the npm package")
8590 Removes leading and trailing whitespace or specified characters from `string`.
8593 1. `[string='']` *(string)*: The string to trim.
8594 2. `[chars=whitespace]` *(string)*: The characters to trim.
8597 *(string)*: Returns the trimmed string.
8604 _.trim('-_-abc-_-', '_-');
8607 _.map([' foo ', ' bar '], _.trim);
8608 // => ['foo', 'bar']
8616 ### <a id="_trimendstring-charswhitespace"></a>`_.trimEnd([string=''], [chars=whitespace])`
8617 <a href="#_trimendstring-charswhitespace">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L13039 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.trimend "See the npm package")
8619 Removes trailing whitespace or specified characters from `string`.
8622 1. `[string='']` *(string)*: The string to trim.
8623 2. `[chars=whitespace]` *(string)*: The characters to trim.
8626 *(string)*: Returns the trimmed string.
8633 _.trimEnd('-_-abc-_-', '_-');
8642 ### <a id="_trimstartstring-charswhitespace"></a>`_.trimStart([string=''], [chars=whitespace])`
8643 <a href="#_trimstartstring-charswhitespace">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L13075 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.trimstart "See the npm package")
8645 Removes leading whitespace or specified characters from `string`.
8648 1. `[string='']` *(string)*: The string to trim.
8649 2. `[chars=whitespace]` *(string)*: The characters to trim.
8652 *(string)*: Returns the trimmed string.
8656 _.trimStart(' abc ');
8659 _.trimStart('-_-abc-_-', '_-');
8668 ### <a id="_truncatestring-options-optionslength30-optionsomission-optionsseparator"></a>`_.truncate([string=''], [options=({})], [options.length=30], [options.omission='...'], [options.separator])`
8669 <a href="#_truncatestring-options-optionslength30-optionsomission-optionsseparator">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L13129 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.truncate "See the npm package")
8671 Truncates `string` if it's longer than the given maximum string length.
8672 The last characters of the truncated string are replaced with the omission
8673 string which defaults to "...".
8676 1. `[string='']` *(string)*: The string to truncate.
8677 2. `[options=({})]` *(Object)*: The options object.
8678 3. `[options.length=30]` *(number)*: The maximum string length.
8679 4. `[options.omission='...']` *(string)*: The string to indicate text is omitted.
8680 5. `[options.separator]` *(RegExp|string)*: The separator pattern to truncate to.
8683 *(string)*: Returns the truncated string.
8687 _.truncate('hi-diddly-ho there, neighborino');
8688 // => 'hi-diddly-ho there, neighbo...'
8690 _.truncate('hi-diddly-ho there, neighborino', {
8694 // => 'hi-diddly-ho there,...'
8696 _.truncate('hi-diddly-ho there, neighborino', {
8700 // => 'hi-diddly-ho there...'
8702 _.truncate('hi-diddly-ho there, neighborino', {
8703 'omission': ' [...]'
8705 // => 'hi-diddly-ho there, neig [...]'
8713 ### <a id="_unescapestring"></a>`_.unescape([string=''])`
8714 <a href="#_unescapestring">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L13203 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.unescape "See the npm package")
8716 The inverse of `_.escape`; this method converts the HTML entities
8717 `&`, `<`, `>`, `"`, `'`, and ``` in `string` to their
8718 corresponding characters.
8721 **Note:** No other HTML entities are unescaped. To unescape additional HTML
8722 entities use a third-party library like [_he_](https://mths.be/he).
8725 1. `[string='']` *(string)*: The string to unescape.
8728 *(string)*: Returns the unescaped string.
8732 _.unescape('fred, barney, & pebbles');
8733 // => 'fred, barney, & pebbles'
8741 ### <a id="_uppercasestring"></a>`_.upperCase([string=''])`
8742 <a href="#_uppercasestring">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L13229 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.uppercase "See the npm package")
8744 Converts `string`, as space separated words, to upper case.
8747 1. `[string='']` *(string)*: The string to convert.
8750 *(string)*: Returns the upper cased string.
8754 _.upperCase('--foo-bar');
8757 _.upperCase('fooBar');
8760 _.upperCase('__foo_bar__');
8769 ### <a id="_upperfirststring"></a>`_.upperFirst([string=''])`
8770 <a href="#_upperfirststring">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L12444 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.upperfirst "See the npm package")
8772 Converts the first character of `string` to upper case.
8775 1. `[string='']` *(string)*: The string to convert.
8778 *(string)*: Returns the converted string.
8782 _.upperFirst('fred');
8785 _.upperFirst('FRED');
8794 ### <a id="_wordsstring-pattern"></a>`_.words([string=''], [pattern])`
8795 <a href="#_wordsstring-pattern">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L13251 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.words "See the npm package")
8797 Splits `string` into an array of its words.
8800 1. `[string='']` *(string)*: The string to inspect.
8801 2. `[pattern]` *(RegExp|string)*: The pattern to match words.
8804 *(Array)*: Returns the words of `string`.
8808 _.words('fred, barney, & pebbles');
8809 // => ['fred', 'barney', 'pebbles']
8811 _.words('fred, barney, & pebbles', /[^, ]+/g);
8812 // => ['fred', 'barney', '&', 'pebbles']
8826 ### <a id="_attemptfunc"></a>`_.attempt(func)`
8827 <a href="#_attemptfunc">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L13283 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.attempt "See the npm package")
8829 Attempts to invoke `func`, returning either the result or the caught error
8830 object. Any additional arguments are provided to `func` when it's invoked.
8833 1. `func` *(Function)*: The function to attempt.
8836 *(*)*: Returns the `func` result or error object.
8840 // Avoid throwing errors for invalid selectors.
8841 var elements = _.attempt(function(selector) {
8842 return document.querySelectorAll(selector);
8845 if (_.isError(elements)) {
8855 ### <a id="_bindallobject-methodnames"></a>`_.bindAll(object, methodNames)`
8856 <a href="#_bindallobject-methodnames">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L13317 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.bindall "See the npm package")
8858 Binds methods of an object to the object itself, overwriting the existing
8862 **Note:** This method doesn't set the "length" property of bound functions.
8865 1. `object` *(Object)*: The object to bind and assign the bound methods to.
8866 2. `methodNames` *(...(string|string[])*: The object method names to bind, specified individually or in arrays.
8869 *(Object)*: Returns `object`.
8875 'onClick': function() {
8876 console.log('clicked ' + this.label);
8880 _.bindAll(view, 'onClick');
8881 jQuery(element).on('click', view.onClick);
8882 // => logs 'clicked docs' when clicked
8890 ### <a id="_condpairs"></a>`_.cond(pairs)`
8891 <a href="#_condpairs">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L13352 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.cond "See the npm package")
8893 Creates a function that iterates over `pairs` invoking the corresponding
8894 function of the first predicate to return truthy. The predicate-function
8895 pairs are invoked with the `this` binding and arguments of the created
8899 1. `pairs` *(Array)*: The predicate-function pairs.
8902 *(Function)*: Returns the new function.
8907 [_.matches({ 'a': 1 }), _.constant('matches A')],
8908 [_.conforms({ 'b': _.isNumber }), _.constant('matches B')],
8909 [_.constant(true), _.constant('no match')]
8912 func({ 'a': 1, 'b': 2 });
8915 func({ 'a': 0, 'b': 1 });
8918 func({ 'a': '1', 'b': '2' });
8927 ### <a id="_conformssource"></a>`_.conforms(source)`
8928 <a href="#_conformssource">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L13394 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.conforms "See the npm package")
8930 Creates a function that invokes the predicate properties of `source` with
8931 the corresponding property values of a given object, returning `true` if
8932 all predicates return truthy, else `false`.
8935 1. `source` *(Object)*: The object of property predicates to conform to.
8938 *(Function)*: Returns the new function.
8943 { 'user': 'barney', 'age': 36 },
8944 { 'user': 'fred', 'age': 40 }
8947 _.filter(users, _.conforms({ 'age': _.partial(_.gt, _, 38) }));
8948 // => [{ 'user': 'fred', 'age': 40 }]
8956 ### <a id="_constantvalue"></a>`_.constant(value)`
8957 <a href="#_constantvalue">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L13414 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.constant "See the npm package")
8959 Creates a function that returns `value`.
8962 1. `value` *(*)*: The value to return from the new function.
8965 *(Function)*: Returns the new function.
8969 var object = { 'user': 'fred' };
8970 var getter = _.constant(object);
8972 getter() === object;
8981 ### <a id="_flowfuncs"></a>`_.flow([funcs])`
8982 <a href="#_flowfuncs">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L13440 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.flow "See the npm package")
8984 Creates a function that returns the result of invoking the given functions
8985 with the `this` binding of the created function, where each successive
8986 invocation is supplied the return value of the previous.
8989 1. `[funcs]` *(...(Function|Function[])*: Functions to invoke.
8992 *(Function)*: Returns the new function.
8996 function square(n) {
9000 var addSquare = _.flow(_.add, square);
9010 ### <a id="_flowrightfuncs"></a>`_.flowRight([funcs])`
9011 <a href="#_flowrightfuncs">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L13461 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.flowright "See the npm package")
9013 This method is like `_.flow` except that it creates a function that
9014 invokes the given functions from right to left.
9017 1. `[funcs]` *(...(Function|Function[])*: Functions to invoke.
9020 *(Function)*: Returns the new function.
9024 function square(n) {
9028 var addSquare = _.flowRight(square, _.add);
9038 ### <a id="_identityvalue"></a>`_.identity(value)`
9039 <a href="#_identityvalue">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L13478 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.identity "See the npm package")
9041 This method returns the first argument given to it.
9044 1. `value` *(*)*: Any value.
9047 *(*)*: Returns `value`.
9051 var object = { 'user': 'fred' };
9053 _.identity(object) === object;
9062 ### <a id="_iterateefunc_identity"></a>`_.iteratee([func=_.identity])`
9063 <a href="#_iterateefunc_identity">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L13512 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.iteratee "See the npm package")
9065 Creates a function that invokes `func` with the arguments of the created
9066 function. If `func` is a property name the created callback returns the
9067 property value for a given element. If `func` is an object the created
9068 callback returns `true` for elements that contain the equivalent object
9069 properties, otherwise it returns `false`.
9072 1. `[func=_.identity]` *(*)*: The value to convert to a callback.
9075 *(Function)*: Returns the callback.
9080 { 'user': 'barney', 'age': 36 },
9081 { 'user': 'fred', 'age': 40 }
9084 // Create custom iteratee shorthands.
9085 _.iteratee = _.wrap(_.iteratee, function(callback, func) {
9086 var p = /^(\S+)\s*([<>])\s*(\S+)$/.exec(func);
9087 return !p ? callback(func) : function(object) {
9088 return (p[2] == '>' ? object[p[1]] > p[3] : object[p[1]] < p[3]);
9092 _.filter(users, 'age > 36');
9093 // => [{ 'user': 'fred', 'age': 40 }]
9101 ### <a id="_matchessource"></a>`_.matches(source)`
9102 <a href="#_matchessource">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L13539 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.matches "See the npm package")
9104 Creates a function that performs a partial deep comparison between a given
9105 object and `source`, returning `true` if the given object has equivalent
9106 property values, else `false`. The created function is equivalent to
9107 `_.isMatch` with a `source` partially applied.
9110 **Note:** This method supports comparing the same values as `_.isEqual`.
9113 1. `source` *(Object)*: The object of property values to match.
9116 *(Function)*: Returns the new function.
9121 { 'user': 'barney', 'age': 36, 'active': true },
9122 { 'user': 'fred', 'age': 40, 'active': false }
9125 _.filter(users, _.matches({ 'age': 40, 'active': false }));
9126 // => [{ 'user': 'fred', 'age': 40, 'active': false }]
9134 ### <a id="_matchespropertypath-srcvalue"></a>`_.matchesProperty(path, srcValue)`
9135 <a href="#_matchespropertypath-srcvalue">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L13566 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.matchesproperty "See the npm package")
9137 Creates a function that performs a partial deep comparison between the
9138 value at `path` of a given object to `srcValue`, returning `true` if the
9139 object value is equivalent, else `false`.
9142 **Note:** This method supports comparing the same values as `_.isEqual`.
9145 1. `path` *(Array|string)*: The path of the property to get.
9146 2. `srcValue` *(*)*: The value to match.
9149 *(Function)*: Returns the new function.
9154 { 'user': 'barney' },
9158 _.find(users, _.matchesProperty('user', 'fred'));
9159 // => { 'user': 'fred' }
9167 ### <a id="_methodpath-args"></a>`_.method(path, [args])`
9168 <a href="#_methodpath-args">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L13593 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.method "See the npm package")
9170 Creates a function that invokes the method at `path` of a given object.
9171 Any additional arguments are provided to the invoked method.
9174 1. `path` *(Array|string)*: The path of the method to invoke.
9175 2. `[args]` *(...*)*: The arguments to invoke the method with.
9178 *(Function)*: Returns the new function.
9183 { 'a': { 'b': { 'c': _.constant(2) } } },
9184 { 'a': { 'b': { 'c': _.constant(1) } } }
9187 _.map(objects, _.method('a.b.c'));
9190 _.invokeMap(_.sortBy(objects, _.method(['a', 'b', 'c'])), 'a.b.c');
9199 ### <a id="_methodofobject-args"></a>`_.methodOf(object, [args])`
9200 <a href="#_methodofobject-args">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L13621 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.methodof "See the npm package")
9202 The opposite of `_.method`; this method creates a function that invokes
9203 the method at a given path of `object`. Any additional arguments are
9204 provided to the invoked method.
9207 1. `object` *(Object)*: The object to query.
9208 2. `[args]` *(...*)*: The arguments to invoke the method with.
9211 *(Function)*: Returns the new function.
9215 var array = _.times(3, _.constant),
9216 object = { 'a': array, 'b': array, 'c': array };
9218 _.map(['a[2]', 'c[0]'], _.methodOf(object));
9221 _.map([['a', '2'], ['c', '0']], _.methodOf(object));
9230 ### <a id="_mixinobjectlodash-source-options"></a>`_.mixin([object=lodash], source, [options])`
9231 <a href="#_mixinobjectlodash-source-options">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L13663 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.mixin "See the npm package")
9233 Adds all own enumerable function properties of a source object to the
9234 destination object. If `object` is a function then methods are added to
9235 its prototype as well.
9238 **Note:** Use `_.runInContext` to create a pristine `lodash` function to
9239 avoid conflicts caused by modifying the original.
9242 1. `[object=lodash]` *(Function|Object)*: The destination object.
9243 2. `source` *(Object)*: The object of functions to add.
9244 3. `[options]` *(Object)*: The options object.
9245 4. `[options.chain=true]` *(boolean)*: Specify whether the functions added are chainable.
9248 *(Function|Object)*: Returns `object`.
9252 function vowels(string) {
9253 return _.filter(string, function(v) {
9254 return /[aeiou]/i.test(v);
9258 _.mixin({ 'vowels': vowels });
9262 _('fred').vowels().value();
9265 _.mixin({ 'vowels': vowels }, { 'chain': false });
9275 ### <a id="_noconflict"></a>`_.noConflict()`
9276 <a href="#_noconflict">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L13711 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.noconflict "See the npm package")
9278 Reverts the `_` variable to its previous value and returns a reference to
9279 the `lodash` function.
9282 *(Function)*: Returns the `lodash` function.
9286 var lodash = _.noConflict();
9294 ### <a id="_noop"></a>`_.noop()`
9295 <a href="#_noop">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L13732 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.noop "See the npm package")
9297 A no-operation function that returns `undefined` regardless of the
9298 arguments it receives.
9302 var object = { 'user': 'fred' };
9304 _.noop(object) === undefined;
9313 ### <a id="_nthargn0"></a>`_.nthArg([n=0])`
9314 <a href="#_nthargn0">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L13751 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.ntharg "See the npm package")
9316 Creates a function that returns its nth argument.
9319 1. `[n=0]` *(number)*: The index of the argument to return.
9322 *(Function)*: Returns the new function.
9326 var func = _.nthArg(1);
9328 func('a', 'b', 'c');
9337 ### <a id="_overiteratees"></a>`_.over(iteratees)`
9338 <a href="#_overiteratees">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L13774 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.over "See the npm package")
9340 Creates a function that invokes `iteratees` with the arguments provided
9341 to the created function and returns their results.
9344 1. `iteratees` *(...(Function|Function[])*: The iteratees to invoke.
9347 *(Function)*: Returns the new function.
9351 var func = _.over(Math.max, Math.min);
9362 ### <a id="_overeverypredicates"></a>`_.overEvery(predicates)`
9363 <a href="#_overeverypredicates">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L13798 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.overevery "See the npm package")
9365 Creates a function that checks if **all** of the `predicates` return
9366 truthy when invoked with the arguments provided to the created function.
9369 1. `predicates` *(...(Function|Function[])*: The predicates to check.
9372 *(Function)*: Returns the new function.
9376 var func = _.overEvery(Boolean, isFinite);
9393 ### <a id="_oversomepredicates"></a>`_.overSome(predicates)`
9394 <a href="#_oversomepredicates">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L13822 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.oversome "See the npm package")
9396 Creates a function that checks if **any** of the `predicates` return
9397 truthy when invoked with the arguments provided to the created function.
9400 1. `predicates` *(...(Function|Function[])*: The predicates to check.
9403 *(Function)*: Returns the new function.
9407 var func = _.overSome(Boolean, isFinite);
9424 ### <a id="_propertypath"></a>`_.property(path)`
9425 <a href="#_propertypath">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L13845 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.property "See the npm package")
9427 Creates a function that returns the value at `path` of a given object.
9430 1. `path` *(Array|string)*: The path of the property to get.
9433 *(Function)*: Returns the new function.
9438 { 'a': { 'b': { 'c': 2 } } },
9439 { 'a': { 'b': { 'c': 1 } } }
9442 _.map(objects, _.property('a.b.c'));
9445 _.map(_.sortBy(objects, _.property(['a', 'b', 'c'])), 'a.b.c');
9454 ### <a id="_propertyofobject"></a>`_.propertyOf(object)`
9455 <a href="#_propertyofobject">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L13869 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.propertyof "See the npm package")
9457 The opposite of `_.property`; this method creates a function that returns
9458 the value at a given path of `object`.
9461 1. `object` *(Object)*: The object to query.
9464 *(Function)*: Returns the new function.
9468 var array = [0, 1, 2],
9469 object = { 'a': array, 'b': array, 'c': array };
9471 _.map(['a[2]', 'c[0]'], _.propertyOf(object));
9474 _.map([['a', '2'], ['c', '0']], _.propertyOf(object));
9483 ### <a id="_rangestart0-end-step1"></a>`_.range([start=0], end, [step=1])`
9484 <a href="#_rangestart0-end-step1">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L13914 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.range "See the npm package")
9486 Creates an array of numbers (positive and/or negative) progressing from
9487 `start` up to, but not including, `end`. A step of `-1` is used if a negative
9488 `start` is specified without an `end` or `step`. If `end` is not specified
9489 it's set to `start` with `start` then set to `0`.
9492 **Note:** JavaScript follows the IEEE-754 standard for resolving
9493 floating-point values which can produce unexpected results.
9496 1. `[start=0]` *(number)*: The start of the range.
9497 2. `end` *(number)*: The end of the range.
9498 3. `[step=1]` *(number)*: The value to increment or decrement by.
9501 *(Array)*: Returns the new array of numbers.
9509 // => [0, -1, -2, -3]
9515 // => [0, 5, 10, 15]
9518 // => [0, -1, -2, -3]
9532 ### <a id="_rangerightstart0-end-step1"></a>`_.rangeRight([start=0], end, [step=1])`
9533 <a href="#_rangerightstart0-end-step1">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L13950 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.rangeright "See the npm package")
9535 This method is like `_.range` except that it populates values in
9539 1. `[start=0]` *(number)*: The start of the range.
9540 2. `end` *(number)*: The end of the range.
9541 3. `[step=1]` *(number)*: The value to increment or decrement by.
9544 *(Array)*: Returns the new array of numbers.
9552 // => [-3, -2, -1, 0]
9557 _.rangeRight(0, 20, 5);
9558 // => [15, 10, 5, 0]
9560 _.rangeRight(0, -4, -1);
9561 // => [-3, -2, -1, 0]
9563 _.rangeRight(1, 4, 0);
9575 ### <a id="_runincontextcontextroot"></a>`_.runInContext([context=root])`
9576 <a href="#_runincontextcontextroot">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L1296 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.runincontext "See the npm package")
9578 Create a new pristine `lodash` function using the `context` object.
9581 1. `[context=root]` *(Object)*: The context object.
9584 *(Function)*: Returns a new `lodash` function.
9588 _.mixin({ 'foo': _.constant('foo') });
9590 var lodash = _.runInContext();
9591 lodash.mixin({ 'bar': lodash.constant('bar') });
9593 _.isFunction(_.foo);
9595 _.isFunction(_.bar);
9598 lodash.isFunction(lodash.foo);
9600 lodash.isFunction(lodash.bar);
9603 // Use `context` to mock `Date#getTime` use in `_.now`.
9604 var mock = _.runInContext({
9605 'Date': function() {
9606 return { 'getTime': getTimeMock };
9610 // Create a suped-up `defer` in Node.js.
9611 var defer = _.runInContext({ 'setTimeout': setImmediate }).defer;
9619 ### <a id="_timesn-iteratee_identity"></a>`_.times(n, [iteratee=_.identity])`
9620 <a href="#_timesn-iteratee_identity">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L13970 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.times "See the npm package")
9622 Invokes the iteratee `n` times, returning an array of the results of
9623 each invocation. The iteratee is invoked with one argument; (index).
9626 1. `n` *(number)*: The number of times to invoke `iteratee`.
9627 2. `[iteratee=_.identity]` *(Function)*: The function invoked per iteration.
9630 *(Array)*: Returns the array of results.
9635 // => ['0', '1', '2']
9637 _.times(4, _.constant(true));
9638 // => [true, true, true, true]
9646 ### <a id="_topathvalue"></a>`_.toPath(value)`
9647 <a href="#_topathvalue">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L14013 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.topath "See the npm package")
9649 Converts `value` to a property path array.
9652 1. `value` *(*)*: The value to convert.
9655 *(Array)*: Returns the new property path array.
9660 // => ['a', 'b', 'c']
9662 _.toPath('a[0].b.c');
9663 // => ['a', '0', 'b', 'c']
9665 var path = ['a', 'b', 'c'],
9666 newPath = _.toPath(path);
9668 console.log(newPath);
9669 // => ['a', 'b', 'c']
9671 console.log(path === newPath);
9680 ### <a id="_uniqueidprefix"></a>`_.uniqueId([prefix=''])`
9681 <a href="#_uniqueidprefix">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L14033 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.uniqueid "See the npm package")
9683 Generates a unique ID. If `prefix` is given the ID is appended to it.
9686 1. `[prefix='']` *(string)*: The value to prefix the ID with.
9689 *(string)*: Returns the unique ID.
9693 _.uniqueId('contact_');
9711 ### <a id="_version"></a>`_.VERSION`
9712 <a href="#_version">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L14680 "View in source") [Ⓣ][1]
9714 ({string}): The semantic version number.
9722 ### <a id="_templatesettings"></a>`_.templateSettings`
9723 <a href="#_templatesettings">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L1545 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.templatesettings "See the npm package")
9725 ({Object}): By default, the template delimiters used by lodash are like those in
9726 embedded Ruby (ERB). Change the following template settings to use
9727 alternative delimiters.
9735 ### <a id="_templatesettingsescape"></a>`_.templateSettings.escape`
9736 <a href="#_templatesettingsescape">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L1553 "View in source") [Ⓣ][1]
9738 ({RegExp}): Used to detect `data` property values to be HTML-escaped.
9746 ### <a id="_templatesettingsevaluate"></a>`_.templateSettings.evaluate`
9747 <a href="#_templatesettingsevaluate">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L1561 "View in source") [Ⓣ][1]
9749 ({RegExp}): Used to detect code to be evaluated.
9757 ### <a id="_templatesettingsimports"></a>`_.templateSettings.imports`
9758 <a href="#_templatesettingsimports">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L1585 "View in source") [Ⓣ][1]
9760 ({Object}): Used to import variables into the compiled template.
9768 ### <a id="_templatesettingsimports_"></a>`_.templateSettings.imports._`
9769 <a href="#_templatesettingsimports_">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L1593 "View in source") [Ⓣ][1]
9771 ({Function}): A reference to the `lodash` function.
9779 ### <a id="_templatesettingsinterpolate"></a>`_.templateSettings.interpolate`
9780 <a href="#_templatesettingsinterpolate">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L1569 "View in source") [Ⓣ][1]
9782 ({RegExp}): Used to detect `data` property values to inject.
9790 ### <a id="_templatesettingsvariable"></a>`_.templateSettings.variable`
9791 <a href="#_templatesettingsvariable">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L1577 "View in source") [Ⓣ][1]
9793 ({string}): Used to reference the data object in the template text.
9803 [1]: #array "Jump back to the TOC."