1 # <a href="https://lodash.com/">lodash</a> <span>v4.11.2</span>
3 <!-- div class="toc-container" -->
8 * <a href="#_chunkarray-size1">`_.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="#_ntharray-n0">`_.nth`</a>
36 * <a href="#_pullarray-values">`_.pull`</a>
37 * <a href="#_pullallarray-values">`_.pullAll`</a>
38 * <a href="#_pullallbyarray-values-iteratee_identity">`_.pullAllBy`</a>
39 * <a href="#_pullallwitharray-values-comparator">`_.pullAllWith`</a>
40 * <a href="#_pullatarray-indexes">`_.pullAt`</a>
41 * <a href="#_removearray-predicate_identity">`_.remove`</a>
42 * <a href="#_reversearray">`_.reverse`</a>
43 * <a href="#_slicearray-start0-endarraylength">`_.slice`</a>
44 * <a href="#_sortedindexarray-value">`_.sortedIndex`</a>
45 * <a href="#_sortedindexbyarray-value-iteratee_identity">`_.sortedIndexBy`</a>
46 * <a href="#_sortedindexofarray-value">`_.sortedIndexOf`</a>
47 * <a href="#_sortedlastindexarray-value">`_.sortedLastIndex`</a>
48 * <a href="#_sortedlastindexbyarray-value-iteratee_identity">`_.sortedLastIndexBy`</a>
49 * <a href="#_sortedlastindexofarray-value">`_.sortedLastIndexOf`</a>
50 * <a href="#_sorteduniqarray">`_.sortedUniq`</a>
51 * <a href="#_sorteduniqbyarray-iteratee">`_.sortedUniqBy`</a>
52 * <a href="#_tailarray">`_.tail`</a>
53 * <a href="#_takearray-n1">`_.take`</a>
54 * <a href="#_takerightarray-n1">`_.takeRight`</a>
55 * <a href="#_takerightwhilearray-predicate_identity">`_.takeRightWhile`</a>
56 * <a href="#_takewhilearray-predicate_identity">`_.takeWhile`</a>
57 * <a href="#_unionarrays">`_.union`</a>
58 * <a href="#_unionbyarrays-iteratee_identity">`_.unionBy`</a>
59 * <a href="#_unionwitharrays-comparator">`_.unionWith`</a>
60 * <a href="#_uniqarray">`_.uniq`</a>
61 * <a href="#_uniqbyarray-iteratee_identity">`_.uniqBy`</a>
62 * <a href="#_uniqwitharray-comparator">`_.uniqWith`</a>
63 * <a href="#_unziparray">`_.unzip`</a>
64 * <a href="#_unzipwitharray-iteratee_identity">`_.unzipWith`</a>
65 * <a href="#_withoutarray-values">`_.without`</a>
66 * <a href="#_xorarrays">`_.xor`</a>
67 * <a href="#_xorbyarrays-iteratee_identity">`_.xorBy`</a>
68 * <a href="#_xorwitharrays-comparator">`_.xorWith`</a>
69 * <a href="#_ziparrays">`_.zip`</a>
70 * <a href="#_zipobjectprops-values">`_.zipObject`</a>
71 * <a href="#_zipobjectdeepprops-values">`_.zipObjectDeep`</a>
72 * <a href="#_zipwitharrays-iteratee_identity">`_.zipWith`</a>
79 * <a href="#_countbycollection-iteratee_identity">`_.countBy`</a>
80 * <a href="#_foreachcollection-iteratee_identity" class="alias">`_.each` -> `forEach`</a>
81 * <a href="#_foreachrightcollection-iteratee_identity" class="alias">`_.eachRight` -> `forEachRight`</a>
82 * <a href="#_everycollection-predicate_identity">`_.every`</a>
83 * <a href="#_filtercollection-predicate_identity">`_.filter`</a>
84 * <a href="#_findcollection-predicate_identity">`_.find`</a>
85 * <a href="#_findlastcollection-predicate_identity">`_.findLast`</a>
86 * <a href="#_flatmapcollection-iteratee_identity">`_.flatMap`</a>
87 * <a href="#_flatmapdeepcollection-iteratee_identity">`_.flatMapDeep`</a>
88 * <a href="#_flatmapdepthcollection-iteratee_identity-depth1">`_.flatMapDepth`</a>
89 * <a href="#_foreachcollection-iteratee_identity">`_.forEach`</a>
90 * <a href="#_foreachrightcollection-iteratee_identity">`_.forEachRight`</a>
91 * <a href="#_groupbycollection-iteratee_identity">`_.groupBy`</a>
92 * <a href="#_includescollection-value-fromindex0">`_.includes`</a>
93 * <a href="#_invokemapcollection-path-args">`_.invokeMap`</a>
94 * <a href="#_keybycollection-iteratee_identity">`_.keyBy`</a>
95 * <a href="#_mapcollection-iteratee_identity">`_.map`</a>
96 * <a href="#_orderbycollection-iteratees_identity-orders">`_.orderBy`</a>
97 * <a href="#_partitioncollection-predicate_identity">`_.partition`</a>
98 * <a href="#_reducecollection-iteratee_identity-accumulator">`_.reduce`</a>
99 * <a href="#_reducerightcollection-iteratee_identity-accumulator">`_.reduceRight`</a>
100 * <a href="#_rejectcollection-predicate_identity">`_.reject`</a>
101 * <a href="#_samplecollection">`_.sample`</a>
102 * <a href="#_samplesizecollection-n1">`_.sampleSize`</a>
103 * <a href="#_shufflecollection">`_.shuffle`</a>
104 * <a href="#_sizecollection">`_.size`</a>
105 * <a href="#_somecollection-predicate_identity">`_.some`</a>
106 * <a href="#_sortbycollection-iteratees_identity">`_.sortBy`</a>
113 * <a href="#_now">`_.now`</a>
120 * <a href="#_aftern-func">`_.after`</a>
121 * <a href="#_aryfunc-nfunclength">`_.ary`</a>
122 * <a href="#_beforen-func">`_.before`</a>
123 * <a href="#_bindfunc-thisarg-partials">`_.bind`</a>
124 * <a href="#_bindkeyobject-key-partials">`_.bindKey`</a>
125 * <a href="#_curryfunc-arityfunclength">`_.curry`</a>
126 * <a href="#_curryrightfunc-arityfunclength">`_.curryRight`</a>
127 * <a href="#_debouncefunc-wait0-options-optionsleadingfalse-optionsmaxwait-optionstrailingtrue">`_.debounce`</a>
128 * <a href="#_deferfunc-args">`_.defer`</a>
129 * <a href="#_delayfunc-wait-args">`_.delay`</a>
130 * <a href="#_flipfunc">`_.flip`</a>
131 * <a href="#_memoizefunc-resolver">`_.memoize`</a>
132 * <a href="#_negatepredicate">`_.negate`</a>
133 * <a href="#_oncefunc">`_.once`</a>
134 * <a href="#_overargsfunc">`_.overArgs`</a>
135 * <a href="#_partialfunc-partials">`_.partial`</a>
136 * <a href="#_partialrightfunc-partials">`_.partialRight`</a>
137 * <a href="#_reargfunc-indexes">`_.rearg`</a>
138 * <a href="#_restfunc-startfunclength-1">`_.rest`</a>
139 * <a href="#_spreadfunc-start0">`_.spread`</a>
140 * <a href="#_throttlefunc-wait0-options-optionsleadingtrue-optionstrailingtrue">`_.throttle`</a>
141 * <a href="#_unaryfunc">`_.unary`</a>
142 * <a href="#_wrapvalue-wrapperidentity">`_.wrap`</a>
149 * <a href="#_castarrayvalue">`_.castArray`</a>
150 * <a href="#_clonevalue">`_.clone`</a>
151 * <a href="#_clonedeepvalue">`_.cloneDeep`</a>
152 * <a href="#_clonedeepwithvalue-customizer">`_.cloneDeepWith`</a>
153 * <a href="#_clonewithvalue-customizer">`_.cloneWith`</a>
154 * <a href="#_eqvalue-other">`_.eq`</a>
155 * <a href="#_gtvalue-other">`_.gt`</a>
156 * <a href="#_gtevalue-other">`_.gte`</a>
157 * <a href="#_isargumentsvalue">`_.isArguments`</a>
158 * <a href="#_isarrayvalue">`_.isArray`</a>
159 * <a href="#_isarraybuffervalue">`_.isArrayBuffer`</a>
160 * <a href="#_isarraylikevalue">`_.isArrayLike`</a>
161 * <a href="#_isarraylikeobjectvalue">`_.isArrayLikeObject`</a>
162 * <a href="#_isbooleanvalue">`_.isBoolean`</a>
163 * <a href="#_isbuffervalue">`_.isBuffer`</a>
164 * <a href="#_isdatevalue">`_.isDate`</a>
165 * <a href="#_iselementvalue">`_.isElement`</a>
166 * <a href="#_isemptyvalue">`_.isEmpty`</a>
167 * <a href="#_isequalvalue-other">`_.isEqual`</a>
168 * <a href="#_isequalwithvalue-other-customizer">`_.isEqualWith`</a>
169 * <a href="#_iserrorvalue">`_.isError`</a>
170 * <a href="#_isfinitevalue">`_.isFinite`</a>
171 * <a href="#_isfunctionvalue">`_.isFunction`</a>
172 * <a href="#_isintegervalue">`_.isInteger`</a>
173 * <a href="#_islengthvalue">`_.isLength`</a>
174 * <a href="#_ismapvalue">`_.isMap`</a>
175 * <a href="#_ismatchobject-source">`_.isMatch`</a>
176 * <a href="#_ismatchwithobject-source-customizer">`_.isMatchWith`</a>
177 * <a href="#_isnanvalue">`_.isNaN`</a>
178 * <a href="#_isnativevalue">`_.isNative`</a>
179 * <a href="#_isnilvalue">`_.isNil`</a>
180 * <a href="#_isnullvalue">`_.isNull`</a>
181 * <a href="#_isnumbervalue">`_.isNumber`</a>
182 * <a href="#_isobjectvalue">`_.isObject`</a>
183 * <a href="#_isobjectlikevalue">`_.isObjectLike`</a>
184 * <a href="#_isplainobjectvalue">`_.isPlainObject`</a>
185 * <a href="#_isregexpvalue">`_.isRegExp`</a>
186 * <a href="#_issafeintegervalue">`_.isSafeInteger`</a>
187 * <a href="#_issetvalue">`_.isSet`</a>
188 * <a href="#_isstringvalue">`_.isString`</a>
189 * <a href="#_issymbolvalue">`_.isSymbol`</a>
190 * <a href="#_istypedarrayvalue">`_.isTypedArray`</a>
191 * <a href="#_isundefinedvalue">`_.isUndefined`</a>
192 * <a href="#_isweakmapvalue">`_.isWeakMap`</a>
193 * <a href="#_isweaksetvalue">`_.isWeakSet`</a>
194 * <a href="#_ltvalue-other">`_.lt`</a>
195 * <a href="#_ltevalue-other">`_.lte`</a>
196 * <a href="#_toarrayvalue">`_.toArray`</a>
197 * <a href="#_tointegervalue">`_.toInteger`</a>
198 * <a href="#_tolengthvalue">`_.toLength`</a>
199 * <a href="#_tonumbervalue">`_.toNumber`</a>
200 * <a href="#_toplainobjectvalue">`_.toPlainObject`</a>
201 * <a href="#_tosafeintegervalue">`_.toSafeInteger`</a>
202 * <a href="#_tostringvalue">`_.toString`</a>
209 * <a href="#_addaugend-addend">`_.add`</a>
210 * <a href="#_ceilnumber-precision0">`_.ceil`</a>
211 * <a href="#_dividedividend-divisor">`_.divide`</a>
212 * <a href="#_floornumber-precision0">`_.floor`</a>
213 * <a href="#_maxarray">`_.max`</a>
214 * <a href="#_maxbyarray-iteratee_identity">`_.maxBy`</a>
215 * <a href="#_meanarray">`_.mean`</a>
216 * <a href="#_meanbyarray-iteratee_identity">`_.meanBy`</a>
217 * <a href="#_minarray">`_.min`</a>
218 * <a href="#_minbyarray-iteratee_identity">`_.minBy`</a>
219 * <a href="#_multiplymultiplier-multiplicand">`_.multiply`</a>
220 * <a href="#_roundnumber-precision0">`_.round`</a>
221 * <a href="#_subtractminuend-subtrahend">`_.subtract`</a>
222 * <a href="#_sumarray">`_.sum`</a>
223 * <a href="#_sumbyarray-iteratee_identity">`_.sumBy`</a>
230 * <a href="#_clampnumber-lower-upper">`_.clamp`</a>
231 * <a href="#_inrangenumber-start0-end">`_.inRange`</a>
232 * <a href="#_randomlower0-upper1-floating">`_.random`</a>
239 * <a href="#_assignobject-sources">`_.assign`</a>
240 * <a href="#_assigninobject-sources">`_.assignIn`</a>
241 * <a href="#_assigninwithobject-sources-customizer">`_.assignInWith`</a>
242 * <a href="#_assignwithobject-sources-customizer">`_.assignWith`</a>
243 * <a href="#_atobject-paths">`_.at`</a>
244 * <a href="#_createprototype-properties">`_.create`</a>
245 * <a href="#_defaultsobject-sources">`_.defaults`</a>
246 * <a href="#_defaultsdeepobject-sources">`_.defaultsDeep`</a>
247 * <a href="#_topairsobject" class="alias">`_.entries` -> `toPairs`</a>
248 * <a href="#_topairsinobject" class="alias">`_.entriesIn` -> `toPairsIn`</a>
249 * <a href="#_assigninobject-sources" class="alias">`_.extend` -> `assignIn`</a>
250 * <a href="#_assigninwithobject-sources-customizer" class="alias">`_.extendWith` -> `assignInWith`</a>
251 * <a href="#_findkeyobject-predicate_identity">`_.findKey`</a>
252 * <a href="#_findlastkeyobject-predicate_identity">`_.findLastKey`</a>
253 * <a href="#_forinobject-iteratee_identity">`_.forIn`</a>
254 * <a href="#_forinrightobject-iteratee_identity">`_.forInRight`</a>
255 * <a href="#_forownobject-iteratee_identity">`_.forOwn`</a>
256 * <a href="#_forownrightobject-iteratee_identity">`_.forOwnRight`</a>
257 * <a href="#_functionsobject">`_.functions`</a>
258 * <a href="#_functionsinobject">`_.functionsIn`</a>
259 * <a href="#_getobject-path-defaultvalue">`_.get`</a>
260 * <a href="#_hasobject-path">`_.has`</a>
261 * <a href="#_hasinobject-path">`_.hasIn`</a>
262 * <a href="#_invertobject">`_.invert`</a>
263 * <a href="#_invertbyobject-iteratee_identity">`_.invertBy`</a>
264 * <a href="#_invokeobject-path-args">`_.invoke`</a>
265 * <a href="#_keysobject">`_.keys`</a>
266 * <a href="#_keysinobject">`_.keysIn`</a>
267 * <a href="#_mapkeysobject-iteratee_identity">`_.mapKeys`</a>
268 * <a href="#_mapvaluesobject-iteratee_identity">`_.mapValues`</a>
269 * <a href="#_mergeobject-sources">`_.merge`</a>
270 * <a href="#_mergewithobject-sources-customizer">`_.mergeWith`</a>
271 * <a href="#_omitobject-props">`_.omit`</a>
272 * <a href="#_omitbyobject-predicate_identity">`_.omitBy`</a>
273 * <a href="#_pickobject-props">`_.pick`</a>
274 * <a href="#_pickbyobject-predicate_identity">`_.pickBy`</a>
275 * <a href="#_resultobject-path-defaultvalue">`_.result`</a>
276 * <a href="#_setobject-path-value">`_.set`</a>
277 * <a href="#_setwithobject-path-value-customizer">`_.setWith`</a>
278 * <a href="#_topairsobject">`_.toPairs`</a>
279 * <a href="#_topairsinobject">`_.toPairsIn`</a>
280 * <a href="#_transformobject-iteratee_identity-accumulator">`_.transform`</a>
281 * <a href="#_unsetobject-path">`_.unset`</a>
282 * <a href="#_updateobject-path-updater">`_.update`</a>
283 * <a href="#_updatewithobject-path-updater-customizer">`_.updateWith`</a>
284 * <a href="#_valuesobject">`_.values`</a>
285 * <a href="#_valuesinobject">`_.valuesIn`</a>
292 * <a href="#_value">`_`</a>
293 * <a href="#_chainvalue">`_.chain`</a>
294 * <a href="#_tapvalue-interceptor">`_.tap`</a>
295 * <a href="#_thruvalue-interceptor">`_.thru`</a>
296 * <a href="#_prototypesymboliterator">`_.prototype[Symbol.iterator]`</a>
297 * <a href="#_prototypeatpaths">`_.prototype.at`</a>
298 * <a href="#_prototypechain">`_.prototype.chain`</a>
299 * <a href="#_prototypecommit">`_.prototype.commit`</a>
300 * <a href="#_prototypenext">`_.prototype.next`</a>
301 * <a href="#_prototypeplantvalue">`_.prototype.plant`</a>
302 * <a href="#_prototypereverse">`_.prototype.reverse`</a>
303 * <a href="#_prototypevalue" class="alias">`_.prototype.toJSON` -> `value`</a>
304 * <a href="#_prototypevalue">`_.prototype.value`</a>
305 * <a href="#_prototypevalue" class="alias">`_.prototype.valueOf` -> `value`</a>
312 * <a href="#_camelcasestring">`_.camelCase`</a>
313 * <a href="#_capitalizestring">`_.capitalize`</a>
314 * <a href="#_deburrstring">`_.deburr`</a>
315 * <a href="#_endswithstring-target-positionstringlength">`_.endsWith`</a>
316 * <a href="#_escapestring">`_.escape`</a>
317 * <a href="#_escaperegexpstring">`_.escapeRegExp`</a>
318 * <a href="#_kebabcasestring">`_.kebabCase`</a>
319 * <a href="#_lowercasestring">`_.lowerCase`</a>
320 * <a href="#_lowerfirststring">`_.lowerFirst`</a>
321 * <a href="#_padstring-length0-chars">`_.pad`</a>
322 * <a href="#_padendstring-length0-chars">`_.padEnd`</a>
323 * <a href="#_padstartstring-length0-chars">`_.padStart`</a>
324 * <a href="#_parseintstring-radix10">`_.parseInt`</a>
325 * <a href="#_repeatstring-n1">`_.repeat`</a>
326 * <a href="#_replacestring-pattern-replacement">`_.replace`</a>
327 * <a href="#_snakecasestring">`_.snakeCase`</a>
328 * <a href="#_splitstring-separator-limit">`_.split`</a>
329 * <a href="#_startcasestring">`_.startCase`</a>
330 * <a href="#_startswithstring-target-position0">`_.startsWith`</a>
331 * <a href="#_templatestring-options-optionsescape_templatesettingsescape-optionsevaluate_templatesettingsevaluate-optionsimports_templatesettingsimports-optionsinterpolate_templatesettingsinterpolate-optionssourceurllodashtemplatesourcesn-optionsvariableobj">`_.template`</a>
332 * <a href="#_tolowerstring">`_.toLower`</a>
333 * <a href="#_toupperstring">`_.toUpper`</a>
334 * <a href="#_trimstring-charswhitespace">`_.trim`</a>
335 * <a href="#_trimendstring-charswhitespace">`_.trimEnd`</a>
336 * <a href="#_trimstartstring-charswhitespace">`_.trimStart`</a>
337 * <a href="#_truncatestring-options-optionslength30-optionsomission-optionsseparator">`_.truncate`</a>
338 * <a href="#_unescapestring">`_.unescape`</a>
339 * <a href="#_uppercasestring">`_.upperCase`</a>
340 * <a href="#_upperfirststring">`_.upperFirst`</a>
341 * <a href="#_wordsstring-pattern">`_.words`</a>
348 * <a href="#_attemptfunc-args">`_.attempt`</a>
349 * <a href="#_bindallobject-methodnames">`_.bindAll`</a>
350 * <a href="#_condpairs">`_.cond`</a>
351 * <a href="#_conformssource">`_.conforms`</a>
352 * <a href="#_constantvalue">`_.constant`</a>
353 * <a href="#_flowfuncs">`_.flow`</a>
354 * <a href="#_flowrightfuncs">`_.flowRight`</a>
355 * <a href="#_identityvalue">`_.identity`</a>
356 * <a href="#_iterateefunc_identity">`_.iteratee`</a>
357 * <a href="#_matchessource">`_.matches`</a>
358 * <a href="#_matchespropertypath-srcvalue">`_.matchesProperty`</a>
359 * <a href="#_methodpath-args">`_.method`</a>
360 * <a href="#_methodofobject-args">`_.methodOf`</a>
361 * <a href="#_mixinobjectlodash-source-options-optionschaintrue">`_.mixin`</a>
362 * <a href="#_noconflict">`_.noConflict`</a>
363 * <a href="#_noop">`_.noop`</a>
364 * <a href="#_nthargn0">`_.nthArg`</a>
365 * <a href="#_overiteratees_identity">`_.over`</a>
366 * <a href="#_overeverypredicates_identity">`_.overEvery`</a>
367 * <a href="#_oversomepredicates_identity">`_.overSome`</a>
368 * <a href="#_propertypath">`_.property`</a>
369 * <a href="#_propertyofobject">`_.propertyOf`</a>
370 * <a href="#_rangestart0-end-step1">`_.range`</a>
371 * <a href="#_rangerightstart0-end-step1">`_.rangeRight`</a>
372 * <a href="#_runincontextcontextroot">`_.runInContext`</a>
373 * <a href="#_timesn-iteratee_identity">`_.times`</a>
374 * <a href="#_topathvalue">`_.toPath`</a>
375 * <a href="#_uniqueidprefix">`_.uniqueId`</a>
382 * <a href="#_version">`_.VERSION`</a>
383 * <a href="#_templatesettings">`_.templateSettings`</a>
384 * <a href="#_templatesettingsescape">`_.templateSettings.escape`</a>
385 * <a href="#_templatesettingsevaluate">`_.templateSettings.evaluate`</a>
386 * <a href="#_templatesettingsimports">`_.templateSettings.imports`</a>
387 * <a href="#_templatesettingsinterpolate">`_.templateSettings.interpolate`</a>
388 * <a href="#_templatesettingsvariable">`_.templateSettings.variable`</a>
395 * <a href="#_templatesettingsimports_">`_.templateSettings.imports._`</a>
401 <!-- div class="doc-container" -->
409 ### <a id="_chunkarray-size1"></a>`_.chunk(array, [size=1])`
410 <a href="#_chunkarray-size1">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L5982 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.chunk "See the npm package")
412 Creates an array of elements split into groups the length of `size`.
413 If `array` can't be split evenly, the final chunk will be the remaining
419 1. `array` *(Array)*: The array to process.
420 2. `[size=1]` *(number)*: The length of each chunk
423 *(Array)*: Returns the new array containing chunks.
427 _.chunk(['a', 'b', 'c', 'd'], 2);
428 // => [['a', 'b'], ['c', 'd']]
430 _.chunk(['a', 'b', 'c', 'd'], 3);
431 // => [['a', 'b', 'c'], ['d']]
439 ### <a id="_compactarray"></a>`_.compact(array)`
440 <a href="#_compactarray">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6017 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.compact "See the npm package")
442 Creates an array with all falsey values removed. The values `false`, `null`,
443 `0`, `""`, `undefined`, and `NaN` are falsey.
448 1. `array` *(Array)*: The array to compact.
451 *(Array)*: Returns the new array of filtered values.
455 _.compact([0, 1, false, 2, '', 3]);
464 ### <a id="_concatarray-values"></a>`_.concat(array, [values])`
465 <a href="#_concatarray-values">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6054 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.concat "See the npm package")
467 Creates a new array concatenating `array` with any additional arrays
473 1. `array` *(Array)*: The array to concatenate.
474 2. `[values]` *(...*)*: The values to concatenate.
477 *(Array)*: Returns the new concatenated array.
482 var other = _.concat(array, 2, [3], [[4]]);
496 ### <a id="_differencearray-values"></a>`_.difference(array, [values])`
497 <a href="#_differencearray-values">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6087 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.difference "See the npm package")
499 Creates an array of unique `array` values not included in the other given
500 arrays using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
501 for equality comparisons. The order of result values is determined by the
502 order they occur in the first array.
507 1. `array` *(Array)*: The array to inspect.
508 2. `[values]` *(...Array)*: The values to exclude.
511 *(Array)*: Returns the new array of filtered values.
515 _.difference([3, 2, 1], [4, 2]);
524 ### <a id="_differencebyarray-values-iteratee_identity"></a>`_.differenceBy(array, [values], [iteratee=_.identity])`
525 <a href="#_differencebyarray-values-iteratee_identity">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6117 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.differenceby "See the npm package")
527 This method is like `_.difference` except that it accepts `iteratee` which
528 is invoked for each element of `array` and `values` to generate the criterion
529 by which they're compared. Result values are chosen from the first array.
530 The iteratee is invoked with one argument: *(value)*.
535 1. `array` *(Array)*: The array to inspect.
536 2. `[values]` *(...Array)*: The values to exclude.
537 3. `[iteratee=_.identity]` *(Array|Function|Object|string)*: The iteratee invoked per element.
540 *(Array)*: Returns the new array of filtered values.
544 _.differenceBy([3.1, 2.2, 1.3], [4.4, 2.5], Math.floor);
547 // The `_.property` iteratee shorthand.
548 _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x');
557 ### <a id="_differencewitharray-values-comparator"></a>`_.differenceWith(array, [values], [comparator])`
558 <a href="#_differencewitharray-values-comparator">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6148 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.differencewith "See the npm package")
560 This method is like `_.difference` except that it accepts `comparator`
561 which is invoked to compare elements of `array` to `values`. Result values
562 are chosen from the first array. The comparator is invoked with two arguments:<br>
568 1. `array` *(Array)*: The array to inspect.
569 2. `[values]` *(...Array)*: The values to exclude.
570 3. `[comparator]` *(Function)*: The comparator invoked per element.
573 *(Array)*: Returns the new array of filtered values.
577 var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
579 _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual);
580 // => [{ 'x': 2, 'y': 1 }]
588 ### <a id="_droparray-n1"></a>`_.drop(array, [n=1])`
589 <a href="#_droparray-n1">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6183 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.drop "See the npm package")
591 Creates a slice of `array` with `n` elements dropped from the beginning.
596 1. `array` *(Array)*: The array to query.
597 2. `[n=1]` *(number)*: The number of elements to drop.
600 *(Array)*: Returns the slice of `array`.
607 _.drop([1, 2, 3], 2);
610 _.drop([1, 2, 3], 5);
613 _.drop([1, 2, 3], 0);
622 ### <a id="_droprightarray-n1"></a>`_.dropRight(array, [n=1])`
623 <a href="#_droprightarray-n1">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6217 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.dropright "See the npm package")
625 Creates a slice of `array` with `n` elements dropped from the end.
630 1. `array` *(Array)*: The array to query.
631 2. `[n=1]` *(number)*: The number of elements to drop.
634 *(Array)*: Returns the slice of `array`.
638 _.dropRight([1, 2, 3]);
641 _.dropRight([1, 2, 3], 2);
644 _.dropRight([1, 2, 3], 5);
647 _.dropRight([1, 2, 3], 0);
656 ### <a id="_droprightwhilearray-predicate_identity"></a>`_.dropRightWhile(array, [predicate=_.identity])`
657 <a href="#_droprightwhilearray-predicate_identity">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6263 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.droprightwhile "See the npm package")
659 Creates a slice of `array` excluding elements dropped from the end.
660 Elements are dropped until `predicate` returns falsey. The predicate is
661 invoked with three arguments: *(value, index, array)*.
666 1. `array` *(Array)*: The array to query.
667 2. `[predicate=_.identity]` *(Array|Function|Object|string)*: The function invoked per iteration.
670 *(Array)*: Returns the slice of `array`.
675 { 'user': 'barney', 'active': true },
676 { 'user': 'fred', 'active': false },
677 { 'user': 'pebbles', 'active': false }
680 _.dropRightWhile(users, function(o) { return !o.active; });
681 // => objects for ['barney']
683 // The `_.matches` iteratee shorthand.
684 _.dropRightWhile(users, { 'user': 'pebbles', 'active': false });
685 // => objects for ['barney', 'fred']
687 // The `_.matchesProperty` iteratee shorthand.
688 _.dropRightWhile(users, ['active', false]);
689 // => objects for ['barney']
691 // The `_.property` iteratee shorthand.
692 _.dropRightWhile(users, 'active');
693 // => objects for ['barney', 'fred', 'pebbles']
701 ### <a id="_dropwhilearray-predicate_identity"></a>`_.dropWhile(array, [predicate=_.identity])`
702 <a href="#_dropwhilearray-predicate_identity">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6305 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.dropwhile "See the npm package")
704 Creates a slice of `array` excluding elements dropped from the beginning.
705 Elements are dropped until `predicate` returns falsey. The predicate is
706 invoked with three arguments: *(value, index, array)*.
711 1. `array` *(Array)*: The array to query.
712 2. `[predicate=_.identity]` *(Array|Function|Object|string)*: The function invoked per iteration.
715 *(Array)*: Returns the slice of `array`.
720 { 'user': 'barney', 'active': false },
721 { 'user': 'fred', 'active': false },
722 { 'user': 'pebbles', 'active': true }
725 _.dropWhile(users, function(o) { return !o.active; });
726 // => objects for ['pebbles']
728 // The `_.matches` iteratee shorthand.
729 _.dropWhile(users, { 'user': 'barney', 'active': false });
730 // => objects for ['fred', 'pebbles']
732 // The `_.matchesProperty` iteratee shorthand.
733 _.dropWhile(users, ['active', false]);
734 // => objects for ['pebbles']
736 // The `_.property` iteratee shorthand.
737 _.dropWhile(users, 'active');
738 // => objects for ['barney', 'fred', 'pebbles']
746 ### <a id="_fillarray-value-start0-endarraylength"></a>`_.fill(array, value, [start=0], [end=array.length])`
747 <a href="#_fillarray-value-start0-endarraylength">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6340 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.fill "See the npm package")
749 Fills elements of `array` with `value` from `start` up to, but not
753 **Note:** This method mutates `array`.
758 1. `array` *(Array)*: The array to fill.
759 2. `value` *(*)*: The value to fill `array` with.
760 3. `[start=0]` *(number)*: The start position.
761 4. `[end=array.length]` *(number)*: The end position.
764 *(Array)*: Returns `array`.
768 var array = [1, 2, 3];
772 // => ['a', 'a', 'a']
777 _.fill([4, 6, 8, 10], '*', 1, 3);
778 // => [4, '*', '*', 10]
786 ### <a id="_findindexarray-predicate_identity"></a>`_.findIndex(array, [predicate=_.identity])`
787 <a href="#_findindexarray-predicate_identity">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6387 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.findindex "See the npm package")
789 This method is like `_.find` except that it returns the index of the first
790 element `predicate` returns truthy for instead of the element itself.
795 1. `array` *(Array)*: The array to search.
796 2. `[predicate=_.identity]` *(Array|Function|Object|string)*: The function invoked per iteration.
799 *(number)*: Returns the index of the found element, else `-1`.
804 { 'user': 'barney', 'active': false },
805 { 'user': 'fred', 'active': false },
806 { 'user': 'pebbles', 'active': true }
809 _.findIndex(users, function(o) { return o.user == 'barney'; });
812 // The `_.matches` iteratee shorthand.
813 _.findIndex(users, { 'user': 'fred', 'active': false });
816 // The `_.matchesProperty` iteratee shorthand.
817 _.findIndex(users, ['active', false]);
820 // The `_.property` iteratee shorthand.
821 _.findIndex(users, 'active');
830 ### <a id="_findlastindexarray-predicate_identity"></a>`_.findLastIndex(array, [predicate=_.identity])`
831 <a href="#_findlastindexarray-predicate_identity">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6428 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.findlastindex "See the npm package")
833 This method is like `_.findIndex` except that it iterates over elements
834 of `collection` from right to left.
839 1. `array` *(Array)*: The array to search.
840 2. `[predicate=_.identity]` *(Array|Function|Object|string)*: The function invoked per iteration.
843 *(number)*: Returns the index of the found element, else `-1`.
848 { 'user': 'barney', 'active': true },
849 { 'user': 'fred', 'active': false },
850 { 'user': 'pebbles', 'active': false }
853 _.findLastIndex(users, function(o) { return o.user == 'pebbles'; });
856 // The `_.matches` iteratee shorthand.
857 _.findLastIndex(users, { 'user': 'barney', 'active': true });
860 // The `_.matchesProperty` iteratee shorthand.
861 _.findLastIndex(users, ['active', false]);
864 // The `_.property` iteratee shorthand.
865 _.findLastIndex(users, 'active');
874 ### <a id="_flattenarray"></a>`_.flatten(array)`
875 <a href="#_flattenarray">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6448 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.flatten "See the npm package")
877 Flattens `array` a single level deep.
882 1. `array` *(Array)*: The array to flatten.
885 *(Array)*: Returns the new flattened array.
889 _.flatten([1, [2, [3, [4]], 5]]);
890 // => [1, 2, [3, [4]], 5]
898 ### <a id="_flattendeeparray"></a>`_.flattenDeep(array)`
899 <a href="#_flattendeeparray">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6467 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.flattendeep "See the npm package")
901 Recursively flattens `array`.
906 1. `array` *(Array)*: The array to flatten.
909 *(Array)*: Returns the new flattened array.
913 _.flattenDeep([1, [2, [3, [4]], 5]]);
914 // => [1, 2, 3, 4, 5]
922 ### <a id="_flattendeptharray-depth1"></a>`_.flattenDepth(array, [depth=1])`
923 <a href="#_flattendeptharray-depth1">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6492 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.flattendepth "See the npm package")
925 Recursively flatten `array` up to `depth` times.
930 1. `array` *(Array)*: The array to flatten.
931 2. `[depth=1]` *(number)*: The maximum recursion depth.
934 *(Array)*: Returns the new flattened array.
938 var array = [1, [2, [3, [4]], 5]];
940 _.flattenDepth(array, 1);
941 // => [1, 2, [3, [4]], 5]
943 _.flattenDepth(array, 2);
944 // => [1, 2, 3, [4], 5]
952 ### <a id="_frompairspairs"></a>`_.fromPairs(pairs)`
953 <a href="#_frompairspairs">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6516 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.frompairs "See the npm package")
955 The inverse of `_.toPairs`; this method returns an object composed
956 from key-value `pairs`.
961 1. `pairs` *(Array)*: The key-value pairs.
964 *(Object)*: Returns the new object.
968 _.fromPairs([['fred', 30], ['barney', 40]]);
969 // => { 'fred': 30, 'barney': 40 }
977 ### <a id="_headarray"></a>`_.head(array)`
978 <a href="#_headarray">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6546 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.head "See the npm package")
980 Gets the first element of `array`.
988 1. `array` *(Array)*: The array to query.
991 *(*)*: Returns the first element of `array`.
1007 ### <a id="_indexofarray-value-fromindex0"></a>`_.indexOf(array, value, [fromIndex=0])`
1008 <a href="#_indexofarray-value-fromindex0">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6573 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.indexof "See the npm package")
1010 Gets the index at which the first occurrence of `value` is found in `array`
1011 using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
1012 for equality comparisons. If `fromIndex` is negative, it's used as the
1013 offset from the end of `array`.
1018 1. `array` *(Array)*: The array to search.
1019 2. `value` *(*)*: The value to search for.
1020 3. `[fromIndex=0]` *(number)*: The index to search from.
1023 *(number)*: Returns the index of the matched value, else `-1`.
1027 _.indexOf([1, 2, 1, 2], 2);
1030 // Search from the `fromIndex`.
1031 _.indexOf([1, 2, 1, 2], 2, 2);
1040 ### <a id="_initialarray"></a>`_.initial(array)`
1041 <a href="#_initialarray">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6599 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.initial "See the npm package")
1043 Gets all but the last element of `array`.
1048 1. `array` *(Array)*: The array to query.
1051 *(Array)*: Returns the slice of `array`.
1055 _.initial([1, 2, 3]);
1064 ### <a id="_intersectionarrays"></a>`_.intersection([arrays])`
1065 <a href="#_intersectionarrays">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6620 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.intersection "See the npm package")
1067 Creates an array of unique values that are included in all given arrays
1068 using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
1069 for equality comparisons. The order of result values is determined by the
1070 order they occur in the first array.
1075 1. `[arrays]` *(...Array)*: The arrays to inspect.
1078 *(Array)*: Returns the new array of intersecting values.
1082 _.intersection([2, 1], [4, 2], [1, 2]);
1091 ### <a id="_intersectionbyarrays-iteratee_identity"></a>`_.intersectionBy([arrays], [iteratee=_.identity])`
1092 <a href="#_intersectionbyarrays-iteratee_identity">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6650 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.intersectionby "See the npm package")
1094 This method is like `_.intersection` except that it accepts `iteratee`
1095 which is invoked for each element of each `arrays` to generate the criterion
1096 by which they're compared. Result values are chosen from the first array.
1097 The iteratee is invoked with one argument: *(value)*.
1102 1. `[arrays]` *(...Array)*: The arrays to inspect.
1103 2. `[iteratee=_.identity]` *(Array|Function|Object|string)*: The iteratee invoked per element.
1106 *(Array)*: Returns the new array of intersecting values.
1110 _.intersectionBy([2.1, 1.2], [4.3, 2.4], Math.floor);
1113 // The `_.property` iteratee shorthand.
1114 _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
1123 ### <a id="_intersectionwitharrays-comparator"></a>`_.intersectionWith([arrays], [comparator])`
1124 <a href="#_intersectionwitharrays-comparator">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6685 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.intersectionwith "See the npm package")
1126 This method is like `_.intersection` except that it accepts `comparator`
1127 which is invoked to compare elements of `arrays`. Result values are chosen
1128 from the first array. The comparator is invoked with two arguments:<br>
1134 1. `[arrays]` *(...Array)*: The arrays to inspect.
1135 2. `[comparator]` *(Function)*: The comparator invoked per element.
1138 *(Array)*: Returns the new array of intersecting values.
1142 var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
1143 var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
1145 _.intersectionWith(objects, others, _.isEqual);
1146 // => [{ 'x': 1, 'y': 2 }]
1154 ### <a id="_joinarray-separator-"></a>`_.join(array, [separator=','])`
1155 <a href="#_joinarray-separator-">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6714 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.join "See the npm package")
1157 Converts all elements in `array` into a string separated by `separator`.
1162 1. `array` *(Array)*: The array to convert.
1163 2. `[separator=',']` *(string)*: The element separator.
1166 *(string)*: Returns the joined string.
1170 _.join(['a', 'b', 'c'], '~');
1179 ### <a id="_lastarray"></a>`_.last(array)`
1180 <a href="#_lastarray">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6732 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.last "See the npm package")
1182 Gets the last element of `array`.
1187 1. `array` *(Array)*: The array to query.
1190 *(*)*: Returns the last element of `array`.
1203 ### <a id="_lastindexofarray-value-fromindexarraylength-1"></a>`_.lastIndexOf(array, value, [fromIndex=array.length-1])`
1204 <a href="#_lastindexofarray-value-fromindexarraylength-1">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6758 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.lastindexof "See the npm package")
1206 This method is like `_.indexOf` except that it iterates over elements of
1207 `array` from right to left.
1212 1. `array` *(Array)*: The array to search.
1213 2. `value` *(*)*: The value to search for.
1214 3. `[fromIndex=array.length-1]` *(number)*: The index to search from.
1217 *(number)*: Returns the index of the matched value, else `-1`.
1221 _.lastIndexOf([1, 2, 1, 2], 2);
1224 // Search from the `fromIndex`.
1225 _.lastIndexOf([1, 2, 1, 2], 2, 2);
1234 ### <a id="_ntharray-n0"></a>`_.nth(array, [n=0])`
1235 <a href="#_ntharray-n0">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6804 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.nth "See the npm package")
1237 Gets the nth element of `array`. If `n` is negative, the nth element
1238 from the end is returned.
1243 1. `array` *(Array)*: The array to query.
1244 2. `[n=0]` *(number)*: The index of the element to return.
1247 *(*)*: Returns the nth element of `array`.
1251 var array = ['a', 'b', 'c', 'd'];
1265 ### <a id="_pullarray-values"></a>`_.pull(array, [values])`
1266 <a href="#_pullarray-values">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6831 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.pull "See the npm package")
1268 Removes all given values from `array` using
1269 [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
1270 for equality comparisons.
1273 **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove`
1274 to remove elements from an array by predicate.
1279 1. `array` *(Array)*: The array to modify.
1280 2. `[values]` *(...*)*: The values to remove.
1283 *(Array)*: Returns `array`.
1287 var array = [1, 2, 3, 1, 2, 3];
1289 _.pull(array, 2, 3);
1299 ### <a id="_pullallarray-values"></a>`_.pullAll(array, values)`
1300 <a href="#_pullallarray-values">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6853 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.pullall "See the npm package")
1302 This method is like `_.pull` except that it accepts an array of values to remove.
1305 **Note:** Unlike `_.difference`, this method mutates `array`.
1310 1. `array` *(Array)*: The array to modify.
1311 2. `values` *(Array)*: The values to remove.
1314 *(Array)*: Returns `array`.
1318 var array = [1, 2, 3, 1, 2, 3];
1320 _.pullAll(array, [2, 3]);
1330 ### <a id="_pullallbyarray-values-iteratee_identity"></a>`_.pullAllBy(array, values, [iteratee=_.identity])`
1331 <a href="#_pullallbyarray-values-iteratee_identity">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6883 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.pullallby "See the npm package")
1333 This method is like `_.pullAll` except that it accepts `iteratee` which is
1334 invoked for each element of `array` and `values` to generate the criterion
1335 by which they're compared. The iteratee is invoked with one argument: *(value)*.
1338 **Note:** Unlike `_.differenceBy`, this method mutates `array`.
1343 1. `array` *(Array)*: The array to modify.
1344 2. `values` *(Array)*: The values to remove.
1345 3. `[iteratee=_.identity]` *(Array|Function|Object|string)*: The iteratee invoked per element.
1348 *(Array)*: Returns `array`.
1352 var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];
1354 _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x');
1364 ### <a id="_pullallwitharray-values-comparator"></a>`_.pullAllWith(array, values, [comparator])`
1365 <a href="#_pullallwitharray-values-comparator">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6912 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.pullallwith "See the npm package")
1367 This method is like `_.pullAll` except that it accepts `comparator` which
1368 is invoked to compare elements of `array` to `values`. The comparator is
1369 invoked with two arguments: *(arrVal, othVal)*.
1372 **Note:** Unlike `_.differenceWith`, this method mutates `array`.
1377 1. `array` *(Array)*: The array to modify.
1378 2. `values` *(Array)*: The values to remove.
1379 3. `[comparator]` *(Function)*: The comparator invoked per element.
1382 *(Array)*: Returns `array`.
1386 var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }];
1388 _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual);
1390 // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }]
1398 ### <a id="_pullatarray-indexes"></a>`_.pullAt(array, [indexes])`
1399 <a href="#_pullatarray-indexes">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6942 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.pullat "See the npm package")
1401 Removes elements from `array` corresponding to `indexes` and returns an
1402 array of removed elements.
1405 **Note:** Unlike `_.at`, this method mutates `array`.
1410 1. `array` *(Array)*: The array to modify.
1411 2. `[indexes]` *(...(number|number[]))*: The indexes of elements to remove.
1414 *(Array)*: Returns the new array of removed elements.
1418 var array = [5, 10, 15, 20];
1419 var evens = _.pullAt(array, 1, 3);
1433 ### <a id="_removearray-predicate_identity"></a>`_.remove(array, [predicate=_.identity])`
1434 <a href="#_removearray-predicate_identity">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6984 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.remove "See the npm package")
1436 Removes all elements from `array` that `predicate` returns truthy for
1437 and returns an array of the removed elements. The predicate is invoked
1438 with three arguments: *(value, index, array)*.
1441 **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull`
1442 to pull elements from an array by value.
1447 1. `array` *(Array)*: The array to modify.
1448 2. `[predicate=_.identity]` *(Array|Function|Object|string)*: The function invoked per iteration.
1451 *(Array)*: Returns the new array of removed elements.
1455 var array = [1, 2, 3, 4];
1456 var evens = _.remove(array, function(n) {
1472 ### <a id="_reversearray"></a>`_.reverse(array)`
1473 <a href="#_reversearray">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7028 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.reverse "See the npm package")
1475 Reverses `array` so that the first element becomes the last, the second
1476 element becomes the second to last, and so on.
1479 **Note:** This method mutates `array` and is based on
1480 [`Array#reverse`](https://mdn.io/Array/reverse).
1485 1. `array` *(Array)*: The array to modify.
1488 *(Array)*: Returns `array`.
1492 var array = [1, 2, 3];
1506 ### <a id="_slicearray-start0-endarraylength"></a>`_.slice(array, [start=0], [end=array.length])`
1507 <a href="#_slicearray-start0-endarraylength">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7048 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.slice "See the npm package")
1509 Creates a slice of `array` from `start` up to, but not including, `end`.
1512 **Note:** This method is used instead of
1513 [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are
1519 1. `array` *(Array)*: The array to slice.
1520 2. `[start=0]` *(number)*: The start position.
1521 3. `[end=array.length]` *(number)*: The end position.
1524 *(Array)*: Returns the slice of `array`.
1532 ### <a id="_sortedindexarray-value"></a>`_.sortedIndex(array, value)`
1533 <a href="#_sortedindexarray-value">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7084 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.sortedindex "See the npm package")
1535 Uses a binary search to determine the lowest index at which `value`
1536 should be inserted into `array` in order to maintain its sort order.
1541 1. `array` *(Array)*: The sorted array to inspect.
1542 2. `value` *(*)*: The value to evaluate.
1545 *(number)*: Returns the index at which `value` should be inserted into `array`.
1549 _.sortedIndex([30, 50], 40);
1552 _.sortedIndex([4, 5], 4);
1561 ### <a id="_sortedindexbyarray-value-iteratee_identity"></a>`_.sortedIndexBy(array, value, [iteratee=_.identity])`
1562 <a href="#_sortedindexbyarray-value-iteratee_identity">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7114 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.sortedindexby "See the npm package")
1564 This method is like `_.sortedIndex` except that it accepts `iteratee`
1565 which is invoked for `value` and each element of `array` to compute their
1566 sort ranking. The iteratee is invoked with one argument: *(value)*.
1571 1. `array` *(Array)*: The sorted array to inspect.
1572 2. `value` *(*)*: The value to evaluate.
1573 3. `[iteratee=_.identity]` *(Array|Function|Object|string)*: The iteratee invoked per element.
1576 *(number)*: Returns the index at which `value` should be inserted into `array`.
1580 var dict = { 'thirty': 30, 'forty': 40, 'fifty': 50 };
1582 _.sortedIndexBy(['thirty', 'fifty'], 'forty', _.propertyOf(dict));
1585 // The `_.property` iteratee shorthand.
1586 _.sortedIndexBy([{ 'x': 4 }, { 'x': 5 }], { 'x': 4 }, 'x');
1595 ### <a id="_sortedindexofarray-value"></a>`_.sortedIndexOf(array, value)`
1596 <a href="#_sortedindexofarray-value">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7134 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.sortedindexof "See the npm package")
1598 This method is like `_.indexOf` except that it performs a binary
1599 search on a sorted `array`.
1604 1. `array` *(Array)*: The array to search.
1605 2. `value` *(*)*: The value to search for.
1608 *(number)*: Returns the index of the matched value, else `-1`.
1612 _.sortedIndexOf([1, 1, 2, 2], 2);
1621 ### <a id="_sortedlastindexarray-value"></a>`_.sortedLastIndex(array, value)`
1622 <a href="#_sortedlastindexarray-value">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7163 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.sortedlastindex "See the npm package")
1624 This method is like `_.sortedIndex` except that it returns the highest
1625 index at which `value` should be inserted into `array` in order to
1626 maintain its sort order.
1631 1. `array` *(Array)*: The sorted array to inspect.
1632 2. `value` *(*)*: The value to evaluate.
1635 *(number)*: Returns the index at which `value` should be inserted into `array`.
1639 _.sortedLastIndex([4, 5], 4);
1648 ### <a id="_sortedlastindexbyarray-value-iteratee_identity"></a>`_.sortedLastIndexBy(array, value, [iteratee=_.identity])`
1649 <a href="#_sortedlastindexbyarray-value-iteratee_identity">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7188 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.sortedlastindexby "See the npm package")
1651 This method is like `_.sortedLastIndex` except that it accepts `iteratee`
1652 which is invoked for `value` and each element of `array` to compute their
1653 sort ranking. The iteratee is invoked with one argument: *(value)*.
1658 1. `array` *(Array)*: The sorted array to inspect.
1659 2. `value` *(*)*: The value to evaluate.
1660 3. `[iteratee=_.identity]` *(Array|Function|Object|string)*: The iteratee invoked per element.
1663 *(number)*: Returns the index at which `value` should be inserted into `array`.
1667 // The `_.property` iteratee shorthand.
1668 _.sortedLastIndexBy([{ 'x': 4 }, { 'x': 5 }], { 'x': 4 }, 'x');
1677 ### <a id="_sortedlastindexofarray-value"></a>`_.sortedLastIndexOf(array, value)`
1678 <a href="#_sortedlastindexofarray-value">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7208 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.sortedlastindexof "See the npm package")
1680 This method is like `_.lastIndexOf` except that it performs a binary
1681 search on a sorted `array`.
1686 1. `array` *(Array)*: The array to search.
1687 2. `value` *(*)*: The value to search for.
1690 *(number)*: Returns the index of the matched value, else `-1`.
1694 _.sortedLastIndexOf([1, 1, 2, 2], 2);
1703 ### <a id="_sorteduniqarray"></a>`_.sortedUniq(array)`
1704 <a href="#_sorteduniqarray">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7234 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.sorteduniq "See the npm package")
1706 This method is like `_.uniq` except that it's designed and optimized
1712 1. `array` *(Array)*: The array to inspect.
1715 *(Array)*: Returns the new duplicate free array.
1719 _.sortedUniq([1, 1, 2]);
1728 ### <a id="_sorteduniqbyarray-iteratee"></a>`_.sortedUniqBy(array, [iteratee])`
1729 <a href="#_sorteduniqbyarray-iteratee">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7256 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.sorteduniqby "See the npm package")
1731 This method is like `_.uniqBy` except that it's designed and optimized
1737 1. `array` *(Array)*: The array to inspect.
1738 2. `[iteratee]` *(Function)*: The iteratee invoked per element.
1741 *(Array)*: Returns the new duplicate free array.
1745 _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor);
1754 ### <a id="_tailarray"></a>`_.tail(array)`
1755 <a href="#_tailarray">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7276 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.tail "See the npm package")
1757 Gets all but the first element of `array`.
1762 1. `array` *(Array)*: The array to query.
1765 *(Array)*: Returns the slice of `array`.
1778 ### <a id="_takearray-n1"></a>`_.take(array, [n=1])`
1779 <a href="#_takearray-n1">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7305 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.take "See the npm package")
1781 Creates a slice of `array` with `n` elements taken from the beginning.
1786 1. `array` *(Array)*: The array to query.
1787 2. `[n=1]` *(number)*: The number of elements to take.
1790 *(Array)*: Returns the slice of `array`.
1797 _.take([1, 2, 3], 2);
1800 _.take([1, 2, 3], 5);
1803 _.take([1, 2, 3], 0);
1812 ### <a id="_takerightarray-n1"></a>`_.takeRight(array, [n=1])`
1813 <a href="#_takerightarray-n1">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7338 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.takeright "See the npm package")
1815 Creates a slice of `array` with `n` elements taken from the end.
1820 1. `array` *(Array)*: The array to query.
1821 2. `[n=1]` *(number)*: The number of elements to take.
1824 *(Array)*: Returns the slice of `array`.
1828 _.takeRight([1, 2, 3]);
1831 _.takeRight([1, 2, 3], 2);
1834 _.takeRight([1, 2, 3], 5);
1837 _.takeRight([1, 2, 3], 0);
1846 ### <a id="_takerightwhilearray-predicate_identity"></a>`_.takeRightWhile(array, [predicate=_.identity])`
1847 <a href="#_takerightwhilearray-predicate_identity">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7384 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.takerightwhile "See the npm package")
1849 Creates a slice of `array` with elements taken from the end. Elements are
1850 taken until `predicate` returns falsey. The predicate is invoked with
1851 three arguments: *(value, index, array)*.
1856 1. `array` *(Array)*: The array to query.
1857 2. `[predicate=_.identity]` *(Array|Function|Object|string)*: The function invoked per iteration.
1860 *(Array)*: Returns the slice of `array`.
1865 { 'user': 'barney', 'active': true },
1866 { 'user': 'fred', 'active': false },
1867 { 'user': 'pebbles', 'active': false }
1870 _.takeRightWhile(users, function(o) { return !o.active; });
1871 // => objects for ['fred', 'pebbles']
1873 // The `_.matches` iteratee shorthand.
1874 _.takeRightWhile(users, { 'user': 'pebbles', 'active': false });
1875 // => objects for ['pebbles']
1877 // The `_.matchesProperty` iteratee shorthand.
1878 _.takeRightWhile(users, ['active', false]);
1879 // => objects for ['fred', 'pebbles']
1881 // The `_.property` iteratee shorthand.
1882 _.takeRightWhile(users, 'active');
1891 ### <a id="_takewhilearray-predicate_identity"></a>`_.takeWhile(array, [predicate=_.identity])`
1892 <a href="#_takewhilearray-predicate_identity">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7426 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.takewhile "See the npm package")
1894 Creates a slice of `array` with elements taken from the beginning. Elements
1895 are taken until `predicate` returns falsey. The predicate is invoked with
1896 three arguments: *(value, index, array)*.
1901 1. `array` *(Array)*: The array to query.
1902 2. `[predicate=_.identity]` *(Array|Function|Object|string)*: The function invoked per iteration.
1905 *(Array)*: Returns the slice of `array`.
1910 { 'user': 'barney', 'active': false },
1911 { 'user': 'fred', 'active': false},
1912 { 'user': 'pebbles', 'active': true }
1915 _.takeWhile(users, function(o) { return !o.active; });
1916 // => objects for ['barney', 'fred']
1918 // The `_.matches` iteratee shorthand.
1919 _.takeWhile(users, { 'user': 'barney', 'active': false });
1920 // => objects for ['barney']
1922 // The `_.matchesProperty` iteratee shorthand.
1923 _.takeWhile(users, ['active', false]);
1924 // => objects for ['barney', 'fred']
1926 // The `_.property` iteratee shorthand.
1927 _.takeWhile(users, 'active');
1936 ### <a id="_unionarrays"></a>`_.union([arrays])`
1937 <a href="#_unionarrays">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7448 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.union "See the npm package")
1939 Creates an array of unique values, in order, from all given arrays using
1940 [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
1941 for equality comparisons.
1946 1. `[arrays]` *(...Array)*: The arrays to inspect.
1949 *(Array)*: Returns the new array of combined values.
1953 _.union([2, 1], [4, 2], [1, 2]);
1962 ### <a id="_unionbyarrays-iteratee_identity"></a>`_.unionBy([arrays], [iteratee=_.identity])`
1963 <a href="#_unionbyarrays-iteratee_identity">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7475 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.unionby "See the npm package")
1965 This method is like `_.union` except that it accepts `iteratee` which is
1966 invoked for each element of each `arrays` to generate the criterion by
1967 which uniqueness is computed. The iteratee is invoked with one argument:<br>
1973 1. `[arrays]` *(...Array)*: The arrays to inspect.
1974 2. `[iteratee=_.identity]` *(Array|Function|Object|string)*: The iteratee invoked per element.
1977 *(Array)*: Returns the new array of combined values.
1981 _.unionBy([2.1, 1.2], [4.3, 2.4], Math.floor);
1982 // => [2.1, 1.2, 4.3]
1984 // The `_.property` iteratee shorthand.
1985 _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
1986 // => [{ 'x': 1 }, { 'x': 2 }]
1994 ### <a id="_unionwitharrays-comparator"></a>`_.unionWith([arrays], [comparator])`
1995 <a href="#_unionwitharrays-comparator">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7503 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.unionwith "See the npm package")
1997 This method is like `_.union` except that it accepts `comparator` which
1998 is invoked to compare elements of `arrays`. The comparator is invoked
1999 with two arguments: *(arrVal, othVal)*.
2004 1. `[arrays]` *(...Array)*: The arrays to inspect.
2005 2. `[comparator]` *(Function)*: The comparator invoked per element.
2008 *(Array)*: Returns the new array of combined values.
2012 var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
2013 var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
2015 _.unionWith(objects, others, _.isEqual);
2016 // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
2024 ### <a id="_uniqarray"></a>`_.uniq(array)`
2025 <a href="#_uniqarray">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7528 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.uniq "See the npm package")
2027 Creates a duplicate-free version of an array, using
2028 [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
2029 for equality comparisons, in which only the first occurrence of each
2035 1. `array` *(Array)*: The array to inspect.
2038 *(Array)*: Returns the new duplicate free array.
2051 ### <a id="_uniqbyarray-iteratee_identity"></a>`_.uniqBy(array, [iteratee=_.identity])`
2052 <a href="#_uniqbyarray-iteratee_identity">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7556 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.uniqby "See the npm package")
2054 This method is like `_.uniq` except that it accepts `iteratee` which is
2055 invoked for each element in `array` to generate the criterion by which
2056 uniqueness is computed. The iteratee is invoked with one argument: *(value)*.
2061 1. `array` *(Array)*: The array to inspect.
2062 2. `[iteratee=_.identity]` *(Array|Function|Object|string)*: The iteratee invoked per element.
2065 *(Array)*: Returns the new duplicate free array.
2069 _.uniqBy([2.1, 1.2, 2.3], Math.floor);
2072 // The `_.property` iteratee shorthand.
2073 _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');
2074 // => [{ 'x': 1 }, { 'x': 2 }]
2082 ### <a id="_uniqwitharray-comparator"></a>`_.uniqWith(array, [comparator])`
2083 <a href="#_uniqwitharray-comparator">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7581 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.uniqwith "See the npm package")
2085 This method is like `_.uniq` except that it accepts `comparator` which
2086 is invoked to compare elements of `array`. The comparator is invoked with
2087 two arguments: *(arrVal, othVal)*.
2092 1. `array` *(Array)*: The array to inspect.
2093 2. `[comparator]` *(Function)*: The comparator invoked per element.
2096 *(Array)*: Returns the new duplicate free array.
2100 var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }];
2102 _.uniqWith(objects, _.isEqual);
2103 // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]
2111 ### <a id="_unziparray"></a>`_.unzip(array)`
2112 <a href="#_unziparray">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7606 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.unzip "See the npm package")
2114 This method is like `_.zip` except that it accepts an array of grouped
2115 elements and creates an array regrouping the elements to their pre-zip
2121 1. `array` *(Array)*: The array of grouped elements to process.
2124 *(Array)*: Returns the new array of regrouped elements.
2128 var zipped = _.zip(['fred', 'barney'], [30, 40], [true, false]);
2129 // => [['fred', 30, true], ['barney', 40, false]]
2132 // => [['fred', 'barney'], [30, 40], [true, false]]
2140 ### <a id="_unzipwitharray-iteratee_identity"></a>`_.unzipWith(array, [iteratee=_.identity])`
2141 <a href="#_unzipwitharray-iteratee_identity">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7643 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.unzipwith "See the npm package")
2143 This method is like `_.unzip` except that it accepts `iteratee` to specify
2144 how regrouped values should be combined. The iteratee is invoked with the
2145 elements of each group: *(...group)*.
2150 1. `array` *(Array)*: The array of grouped elements to process.
2151 2. `[iteratee=_.identity]` *(Function)*: The function to combine regrouped values.
2154 *(Array)*: Returns the new array of regrouped elements.
2158 var zipped = _.zip([1, 2], [10, 20], [100, 200]);
2159 // => [[1, 10, 100], [2, 20, 200]]
2161 _.unzipWith(zipped, _.add);
2170 ### <a id="_withoutarray-values"></a>`_.without(array, [values])`
2171 <a href="#_withoutarray-values">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7674 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.without "See the npm package")
2173 Creates an array excluding all given values using
2174 [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
2175 for equality comparisons.
2180 1. `array` *(Array)*: The array to filter.
2181 2. `[values]` *(...*)*: The values to exclude.
2184 *(Array)*: Returns the new array of filtered values.
2188 _.without([1, 2, 1, 3], 1, 2);
2197 ### <a id="_xorarrays"></a>`_.xor([arrays])`
2198 <a href="#_xorarrays">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7698 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.xor "See the npm package")
2200 Creates an array of unique values that is the
2201 [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)
2202 of the given arrays. The order of result values is determined by the order
2203 they occur in the arrays.
2208 1. `[arrays]` *(...Array)*: The arrays to inspect.
2211 *(Array)*: Returns the new array of values.
2215 _.xor([2, 1], [4, 2]);
2224 ### <a id="_xorbyarrays-iteratee_identity"></a>`_.xorBy([arrays], [iteratee=_.identity])`
2225 <a href="#_xorbyarrays-iteratee_identity">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7725 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.xorby "See the npm package")
2227 This method is like `_.xor` except that it accepts `iteratee` which is
2228 invoked for each element of each `arrays` to generate the criterion by
2229 which by which they're compared. The iteratee is invoked with one argument:<br>
2235 1. `[arrays]` *(...Array)*: The arrays to inspect.
2236 2. `[iteratee=_.identity]` *(Array|Function|Object|string)*: The iteratee invoked per element.
2239 *(Array)*: Returns the new array of values.
2243 _.xorBy([2.1, 1.2], [4.3, 2.4], Math.floor);
2246 // The `_.property` iteratee shorthand.
2247 _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
2256 ### <a id="_xorwitharrays-comparator"></a>`_.xorWith([arrays], [comparator])`
2257 <a href="#_xorwitharrays-comparator">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7753 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.xorwith "See the npm package")
2259 This method is like `_.xor` except that it accepts `comparator` which is
2260 invoked to compare elements of `arrays`. The comparator is invoked with
2261 two arguments: *(arrVal, othVal)*.
2266 1. `[arrays]` *(...Array)*: The arrays to inspect.
2267 2. `[comparator]` *(Function)*: The comparator invoked per element.
2270 *(Array)*: Returns the new array of values.
2274 var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
2275 var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
2277 _.xorWith(objects, others, _.isEqual);
2278 // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
2286 ### <a id="_ziparrays"></a>`_.zip([arrays])`
2287 <a href="#_ziparrays">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7777 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.zip "See the npm package")
2289 Creates an array of grouped elements, the first of which contains the
2290 first elements of the given arrays, the second of which contains the
2291 second elements of the given arrays, and so on.
2296 1. `[arrays]` *(...Array)*: The arrays to process.
2299 *(Array)*: Returns the new array of grouped elements.
2303 _.zip(['fred', 'barney'], [30, 40], [true, false]);
2304 // => [['fred', 30, true], ['barney', 40, false]]
2312 ### <a id="_zipobjectprops-values"></a>`_.zipObject([props=[]], [values=[]])`
2313 <a href="#_zipobjectprops-values">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7795 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.zipobject "See the npm package")
2315 This method is like `_.fromPairs` except that it accepts two arrays,
2316 one of property identifiers and one of corresponding values.
2321 1. `[props=[]]` *(Array)*: The property identifiers.
2322 2. `[values=[]]` *(Array)*: The property values.
2325 *(Object)*: Returns the new object.
2329 _.zipObject(['a', 'b'], [1, 2]);
2330 // => { 'a': 1, 'b': 2 }
2338 ### <a id="_zipobjectdeepprops-values"></a>`_.zipObjectDeep([props=[]], [values=[]])`
2339 <a href="#_zipobjectdeepprops-values">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7814 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.zipobjectdeep "See the npm package")
2341 This method is like `_.zipObject` except that it supports property paths.
2346 1. `[props=[]]` *(Array)*: The property identifiers.
2347 2. `[values=[]]` *(Array)*: The property values.
2350 *(Object)*: Returns the new object.
2354 _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]);
2355 // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } }
2363 ### <a id="_zipwitharrays-iteratee_identity"></a>`_.zipWith([arrays], [iteratee=_.identity])`
2364 <a href="#_zipwitharrays-iteratee_identity">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7837 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.zipwith "See the npm package")
2366 This method is like `_.zip` except that it accepts `iteratee` to specify
2367 how grouped values should be combined. The iteratee is invoked with the
2368 elements of each group: *(...group)*.
2373 1. `[arrays]` *(...Array)*: The arrays to process.
2374 2. `[iteratee=_.identity]` *(Function)*: The function to combine grouped values.
2377 *(Array)*: Returns the new array of grouped elements.
2381 _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) {
2394 ## `“Collection” Methods`
2398 ### <a id="_countbycollection-iteratee_identity"></a>`_.countBy(collection, [iteratee=_.identity])`
2399 <a href="#_countbycollection-iteratee_identity">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L8220 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.countby "See the npm package")
2401 Creates an object composed of keys generated from the results of running
2402 each element of `collection` thru `iteratee`. The corresponding value of
2403 each key is the number of times the key was returned by `iteratee`. The
2404 iteratee is invoked with one argument: *(value)*.
2409 1. `collection` *(Array|Object)*: The collection to iterate over.
2410 2. `[iteratee=_.identity]` *(Array|Function|Object|string)*: The iteratee to transform keys.
2413 *(Object)*: Returns the composed aggregate object.
2417 _.countBy([6.1, 4.2, 6.3], Math.floor);
2418 // => { '4': 1, '6': 2 }
2420 _.countBy(['one', 'two', 'three'], 'length');
2421 // => { '3': 2, '5': 1 }
2429 ### <a id="_everycollection-predicate_identity"></a>`_.every(collection, [predicate=_.identity])`
2430 <a href="#_everycollection-predicate_identity">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L8261 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.every "See the npm package")
2432 Checks if `predicate` returns truthy for **all** elements of `collection`.
2433 Iteration is stopped once `predicate` returns falsey. The predicate is
2434 invoked with three arguments: *(value, index|key, collection)*.
2439 1. `collection` *(Array|Object)*: The collection to iterate over.
2440 2. `[predicate=_.identity]` *(Array|Function|Object|string)*: The function invoked per iteration.
2443 *(boolean)*: Returns `true` if all elements pass the predicate check, else `false`.
2447 _.every([true, 1, null, 'yes'], Boolean);
2451 { 'user': 'barney', 'age': 36, 'active': false },
2452 { 'user': 'fred', 'age': 40, 'active': false }
2455 // The `_.matches` iteratee shorthand.
2456 _.every(users, { 'user': 'barney', 'active': false });
2459 // The `_.matchesProperty` iteratee shorthand.
2460 _.every(users, ['active', false]);
2463 // The `_.property` iteratee shorthand.
2464 _.every(users, 'active');
2473 ### <a id="_filtercollection-predicate_identity"></a>`_.filter(collection, [predicate=_.identity])`
2474 <a href="#_filtercollection-predicate_identity">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L8305 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.filter "See the npm package")
2476 Iterates over elements of `collection`, returning an array of all elements
2477 `predicate` returns truthy for. The predicate is invoked with three
2478 arguments: *(value, index|key, collection)*.
2483 1. `collection` *(Array|Object)*: The collection to iterate over.
2484 2. `[predicate=_.identity]` *(Array|Function|Object|string)*: The function invoked per iteration.
2487 *(Array)*: Returns the new filtered array.
2492 { 'user': 'barney', 'age': 36, 'active': true },
2493 { 'user': 'fred', 'age': 40, 'active': false }
2496 _.filter(users, function(o) { return !o.active; });
2497 // => objects for ['fred']
2499 // The `_.matches` iteratee shorthand.
2500 _.filter(users, { 'age': 36, 'active': true });
2501 // => objects for ['barney']
2503 // The `_.matchesProperty` iteratee shorthand.
2504 _.filter(users, ['active', false]);
2505 // => objects for ['fred']
2507 // The `_.property` iteratee shorthand.
2508 _.filter(users, 'active');
2509 // => objects for ['barney']
2517 ### <a id="_findcollection-predicate_identity"></a>`_.find(collection, [predicate=_.identity])`
2518 <a href="#_findcollection-predicate_identity">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L8346 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.find "See the npm package")
2520 Iterates over elements of `collection`, returning the first element
2521 `predicate` returns truthy for. The predicate is invoked with three
2522 arguments: *(value, index|key, collection)*.
2527 1. `collection` *(Array|Object)*: The collection to search.
2528 2. `[predicate=_.identity]` *(Array|Function|Object|string)*: The function invoked per iteration.
2531 *(*)*: Returns the matched element, else `undefined`.
2536 { 'user': 'barney', 'age': 36, 'active': true },
2537 { 'user': 'fred', 'age': 40, 'active': false },
2538 { 'user': 'pebbles', 'age': 1, 'active': true }
2541 _.find(users, function(o) { return o.age < 40; });
2542 // => object for 'barney'
2544 // The `_.matches` iteratee shorthand.
2545 _.find(users, { 'age': 1, 'active': true });
2546 // => object for 'pebbles'
2548 // The `_.matchesProperty` iteratee shorthand.
2549 _.find(users, ['active', false]);
2550 // => object for 'fred'
2552 // The `_.property` iteratee shorthand.
2553 _.find(users, 'active');
2554 // => object for 'barney'
2562 ### <a id="_findlastcollection-predicate_identity"></a>`_.findLast(collection, [predicate=_.identity])`
2563 <a href="#_findlastcollection-predicate_identity">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L8374 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.findlast "See the npm package")
2565 This method is like `_.find` except that it iterates over elements of
2566 `collection` from right to left.
2571 1. `collection` *(Array|Object)*: The collection to search.
2572 2. `[predicate=_.identity]` *(Array|Function|Object|string)*: The function invoked per iteration.
2575 *(*)*: Returns the matched element, else `undefined`.
2579 _.findLast([1, 2, 3, 4], function(n) {
2590 ### <a id="_flatmapcollection-iteratee_identity"></a>`_.flatMap(collection, [iteratee=_.identity])`
2591 <a href="#_flatmapcollection-iteratee_identity">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L8405 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.flatmap "See the npm package")
2593 Creates a flattened array of values by running each element in `collection`
2594 thru `iteratee` and flattening the mapped results. The iteratee is invoked
2595 with three arguments: *(value, index|key, collection)*.
2600 1. `collection` *(Array|Object)*: The collection to iterate over.
2601 2. `[iteratee=_.identity]` *(Array|Function|Object|string)*: The function invoked per iteration.
2604 *(Array)*: Returns the new flattened array.
2608 function duplicate(n) {
2612 _.flatMap([1, 2], duplicate);
2621 ### <a id="_flatmapdeepcollection-iteratee_identity"></a>`_.flatMapDeep(collection, [iteratee=_.identity])`
2622 <a href="#_flatmapdeepcollection-iteratee_identity">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L8430 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.flatmapdeep "See the npm package")
2624 This method is like `_.flatMap` except that it recursively flattens the
2630 1. `collection` *(Array|Object)*: The collection to iterate over.
2631 2. `[iteratee=_.identity]` *(Array|Function|Object|string)*: The function invoked per iteration.
2634 *(Array)*: Returns the new flattened array.
2638 function duplicate(n) {
2642 _.flatMapDeep([1, 2], duplicate);
2651 ### <a id="_flatmapdepthcollection-iteratee_identity-depth1"></a>`_.flatMapDepth(collection, [iteratee=_.identity], [depth=1])`
2652 <a href="#_flatmapdepthcollection-iteratee_identity-depth1">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L8456 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.flatmapdepth "See the npm package")
2654 This method is like `_.flatMap` except that it recursively flattens the
2655 mapped results up to `depth` times.
2660 1. `collection` *(Array|Object)*: The collection to iterate over.
2661 2. `[iteratee=_.identity]` *(Array|Function|Object|string)*: The function invoked per iteration.
2662 3. `[depth=1]` *(number)*: The maximum recursion depth.
2665 *(Array)*: Returns the new flattened array.
2669 function duplicate(n) {
2673 _.flatMapDepth([1, 2], duplicate, 2);
2674 // => [[1, 1], [2, 2]]
2682 ### <a id="_foreachcollection-iteratee_identity"></a>`_.forEach(collection, [iteratee=_.identity])`
2683 <a href="#_foreachcollection-iteratee_identity">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L8491 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.foreach "See the npm package")
2685 Iterates over elements of `collection` and invokes `iteratee` for each element.
2686 The iteratee is invoked with three arguments: *(value, index|key, collection)*.
2687 Iteratee functions may exit iteration early by explicitly returning `false`.
2690 **Note:** As with other "Collections" methods, objects with a "length"
2691 property are iterated like arrays. To avoid this behavior use `_.forIn`
2692 or `_.forOwn` for object iteration.
2700 1. `collection` *(Array|Object)*: The collection to iterate over.
2701 2. `[iteratee=_.identity]` *(Function)*: The function invoked per iteration.
2704 *(*)*: Returns `collection`.
2708 _([1, 2]).forEach(function(value) {
2711 // => Logs `1` then `2`.
2713 _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {
2716 // => Logs 'a' then 'b' (iteration order is not guaranteed).
2724 ### <a id="_foreachrightcollection-iteratee_identity"></a>`_.forEachRight(collection, [iteratee=_.identity])`
2725 <a href="#_foreachrightcollection-iteratee_identity">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L8517 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.foreachright "See the npm package")
2727 This method is like `_.forEach` except that it iterates over elements of
2728 `collection` from right to left.
2736 1. `collection` *(Array|Object)*: The collection to iterate over.
2737 2. `[iteratee=_.identity]` *(Function)*: The function invoked per iteration.
2740 *(*)*: Returns `collection`.
2744 _.forEachRight([1, 2], function(value) {
2747 // => Logs `2` then `1`.
2755 ### <a id="_groupbycollection-iteratee_identity"></a>`_.groupBy(collection, [iteratee=_.identity])`
2756 <a href="#_groupbycollection-iteratee_identity">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L8547 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.groupby "See the npm package")
2758 Creates an object composed of keys generated from the results of running
2759 each element of `collection` thru `iteratee`. The order of grouped values
2760 is determined by the order they occur in `collection`. The corresponding
2761 value of each key is an array of elements responsible for generating the
2762 key. The iteratee is invoked with one argument: *(value)*.
2767 1. `collection` *(Array|Object)*: The collection to iterate over.
2768 2. `[iteratee=_.identity]` *(Array|Function|Object|string)*: The iteratee to transform keys.
2771 *(Object)*: Returns the composed aggregate object.
2775 _.groupBy([6.1, 4.2, 6.3], Math.floor);
2776 // => { '4': [4.2], '6': [6.1, 6.3] }
2778 // The `_.property` iteratee shorthand.
2779 _.groupBy(['one', 'two', 'three'], 'length');
2780 // => { '3': ['one', 'two'], '5': ['three'] }
2788 ### <a id="_includescollection-value-fromindex0"></a>`_.includes(collection, value, [fromIndex=0])`
2789 <a href="#_includescollection-value-fromindex0">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L8585 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.includes "See the npm package")
2791 Checks if `value` is in `collection`. If `collection` is a string, it's
2792 checked for a substring of `value`, otherwise
2793 [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
2794 is used for equality comparisons. If `fromIndex` is negative, it's used as
2795 the offset from the end of `collection`.
2800 1. `collection` *(Array|Object|string)*: The collection to search.
2801 2. `value` *(*)*: The value to search for.
2802 3. `[fromIndex=0]` *(number)*: The index to search from.
2805 *(boolean)*: Returns `true` if `value` is found, else `false`.
2809 _.includes([1, 2, 3], 1);
2812 _.includes([1, 2, 3], 1, 2);
2815 _.includes({ 'user': 'fred', 'age': 40 }, 'fred');
2818 _.includes('pebbles', 'eb');
2827 ### <a id="_invokemapcollection-path-args"></a>`_.invokeMap(collection, path, [args])`
2828 <a href="#_invokemapcollection-path-args">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L8621 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.invokemap "See the npm package")
2830 Invokes the method at `path` of each element in `collection`, returning
2831 an array of the results of each invoked method. Any additional arguments
2832 are provided to each invoked method. If `methodName` is a function, it's
2833 invoked for and `this` bound to, each element in `collection`.
2838 1. `collection` *(Array|Object)*: The collection to iterate over.
2839 2. `path` *(Array|Function|string)*: The path of the method to invoke or the function invoked per iteration.
2840 3. `[args]` *(...*)*: The arguments to invoke each method with.
2843 *(Array)*: Returns the array of results.
2847 _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort');
2848 // => [[1, 5, 7], [1, 2, 3]]
2850 _.invokeMap([123, 456], String.prototype.split, '');
2851 // => [['1', '2', '3'], ['4', '5', '6']]
2859 ### <a id="_keybycollection-iteratee_identity"></a>`_.keyBy(collection, [iteratee=_.identity])`
2860 <a href="#_keybycollection-iteratee_identity">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L8663 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.keyby "See the npm package")
2862 Creates an object composed of keys generated from the results of running
2863 each element of `collection` thru `iteratee`. The corresponding value of
2864 each key is the last element responsible for generating the key. The
2865 iteratee is invoked with one argument: *(value)*.
2870 1. `collection` *(Array|Object)*: The collection to iterate over.
2871 2. `[iteratee=_.identity]` *(Array|Function|Object|string)*: The iteratee to transform keys.
2874 *(Object)*: Returns the composed aggregate object.
2879 { 'dir': 'left', 'code': 97 },
2880 { 'dir': 'right', 'code': 100 }
2883 _.keyBy(array, function(o) {
2884 return String.fromCharCode(o.code);
2886 // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
2888 _.keyBy(array, 'dir');
2889 // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }
2897 ### <a id="_mapcollection-iteratee_identity"></a>`_.map(collection, [iteratee=_.identity])`
2898 <a href="#_mapcollection-iteratee_identity">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L8710 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.map "See the npm package")
2900 Creates an array of values by running each element in `collection` thru
2901 `iteratee`. The iteratee is invoked with three arguments:<br>
2902 *(value, index|key, collection)*.
2905 Many lodash methods are guarded to work as iteratees for methods like
2906 `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
2909 The guarded methods are:<br>
2910 `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,
2911 `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,
2912 `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,
2913 `template`, `trim`, `trimEnd`, `trimStart`, and `words`
2918 1. `collection` *(Array|Object)*: The collection to iterate over.
2919 2. `[iteratee=_.identity]` *(Array|Function|Object|string)*: The function invoked per iteration.
2922 *(Array)*: Returns the new mapped array.
2926 function square(n) {
2930 _.map([4, 8], square);
2933 _.map({ 'a': 4, 'b': 8 }, square);
2934 // => [16, 64] (iteration order is not guaranteed)
2937 { 'user': 'barney' },
2941 // The `_.property` iteratee shorthand.
2942 _.map(users, 'user');
2943 // => ['barney', 'fred']
2951 ### <a id="_orderbycollection-iteratees_identity-orders"></a>`_.orderBy(collection, [iteratees=[_.identity]], [orders])`
2952 <a href="#_orderbycollection-iteratees_identity-orders">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L8744 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.orderby "See the npm package")
2954 This method is like `_.sortBy` except that it allows specifying the sort
2955 orders of the iteratees to sort by. If `orders` is unspecified, all values
2956 are sorted in ascending order. Otherwise, specify an order of "desc" for
2957 descending or "asc" for ascending sort order of corresponding values.
2962 1. `collection` *(Array|Object)*: The collection to iterate over.
2963 2. `[iteratees=[_.identity]]` *(Array[]|Function[]|Object[]|string[])*: The iteratees to sort by.
2964 3. `[orders]` *(string[])*: The sort orders of `iteratees`.
2967 *(Array)*: Returns the new sorted array.
2972 { 'user': 'fred', 'age': 48 },
2973 { 'user': 'barney', 'age': 34 },
2974 { 'user': 'fred', 'age': 40 },
2975 { 'user': 'barney', 'age': 36 }
2978 // Sort by `user` in ascending order and by `age` in descending order.
2979 _.orderBy(users, ['user', 'age'], ['asc', 'desc']);
2980 // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
2988 ### <a id="_partitioncollection-predicate_identity"></a>`_.partition(collection, [predicate=_.identity])`
2989 <a href="#_partitioncollection-predicate_identity">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L8795 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.partition "See the npm package")
2991 Creates an array of elements split into two groups, the first of which
2992 contains elements `predicate` returns truthy for, the second of which
2993 contains elements `predicate` returns falsey for. The predicate is
2994 invoked with one argument: *(value)*.
2999 1. `collection` *(Array|Object)*: The collection to iterate over.
3000 2. `[predicate=_.identity]` *(Array|Function|Object|string)*: The function invoked per iteration.
3003 *(Array)*: Returns the array of grouped elements.
3008 { 'user': 'barney', 'age': 36, 'active': false },
3009 { 'user': 'fred', 'age': 40, 'active': true },
3010 { 'user': 'pebbles', 'age': 1, 'active': false }
3013 _.partition(users, function(o) { return o.active; });
3014 // => objects for [['fred'], ['barney', 'pebbles']]
3016 // The `_.matches` iteratee shorthand.
3017 _.partition(users, { 'age': 1, 'active': false });
3018 // => objects for [['pebbles'], ['barney', 'fred']]
3020 // The `_.matchesProperty` iteratee shorthand.
3021 _.partition(users, ['active', false]);
3022 // => objects for [['barney', 'pebbles'], ['fred']]
3024 // The `_.property` iteratee shorthand.
3025 _.partition(users, 'active');
3026 // => objects for [['fred'], ['barney', 'pebbles']]
3034 ### <a id="_reducecollection-iteratee_identity-accumulator"></a>`_.reduce(collection, [iteratee=_.identity], [accumulator])`
3035 <a href="#_reducecollection-iteratee_identity-accumulator">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L8836 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.reduce "See the npm package")
3037 Reduces `collection` to a value which is the accumulated result of running
3038 each element in `collection` thru `iteratee`, where each successive
3039 invocation is supplied the return value of the previous. If `accumulator`
3040 is not given, the first element of `collection` is used as the initial
3041 value. The iteratee is invoked with four arguments:<br>
3042 *(accumulator, value, index|key, collection)*.
3045 Many lodash methods are guarded to work as iteratees for methods like
3046 `_.reduce`, `_.reduceRight`, and `_.transform`.
3049 The guarded methods are:<br>
3050 `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,
3056 1. `collection` *(Array|Object)*: The collection to iterate over.
3057 2. `[iteratee=_.identity]` *(Function)*: The function invoked per iteration.
3058 3. `[accumulator]` *(*)*: The initial value.
3061 *(*)*: Returns the accumulated value.
3065 _.reduce([1, 2], function(sum, n) {
3070 _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
3071 (result[value] || (result[value] = [])).push(key);
3074 // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)
3082 ### <a id="_reducerightcollection-iteratee_identity-accumulator"></a>`_.reduceRight(collection, [iteratee=_.identity], [accumulator])`
3083 <a href="#_reducerightcollection-iteratee_identity-accumulator">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L8865 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.reduceright "See the npm package")
3085 This method is like `_.reduce` except that it iterates over elements of
3086 `collection` from right to left.
3091 1. `collection` *(Array|Object)*: The collection to iterate over.
3092 2. `[iteratee=_.identity]` *(Function)*: The function invoked per iteration.
3093 3. `[accumulator]` *(*)*: The initial value.
3096 *(*)*: Returns the accumulated value.
3100 var array = [[0, 1], [2, 3], [4, 5]];
3102 _.reduceRight(array, function(flattened, other) {
3103 return flattened.concat(other);
3105 // => [4, 5, 2, 3, 0, 1]
3113 ### <a id="_rejectcollection-predicate_identity"></a>`_.reject(collection, [predicate=_.identity])`
3114 <a href="#_rejectcollection-predicate_identity">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L8907 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.reject "See the npm package")
3116 The opposite of `_.filter`; this method returns the elements of `collection`
3117 that `predicate` does **not** return truthy for.
3122 1. `collection` *(Array|Object)*: The collection to iterate over.
3123 2. `[predicate=_.identity]` *(Array|Function|Object|string)*: The function invoked per iteration.
3126 *(Array)*: Returns the new filtered array.
3131 { 'user': 'barney', 'age': 36, 'active': false },
3132 { 'user': 'fred', 'age': 40, 'active': true }
3135 _.reject(users, function(o) { return !o.active; });
3136 // => objects for ['fred']
3138 // The `_.matches` iteratee shorthand.
3139 _.reject(users, { 'age': 40, 'active': true });
3140 // => objects for ['barney']
3142 // The `_.matchesProperty` iteratee shorthand.
3143 _.reject(users, ['active', false]);
3144 // => objects for ['fred']
3146 // The `_.property` iteratee shorthand.
3147 _.reject(users, 'active');
3148 // => objects for ['barney']
3156 ### <a id="_samplecollection"></a>`_.sample(collection)`
3157 <a href="#_samplecollection">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L8929 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.sample "See the npm package")
3159 Gets a random element from `collection`.
3164 1. `collection` *(Array|Object)*: The collection to sample.
3167 *(*)*: Returns the random element.
3171 _.sample([1, 2, 3, 4]);
3180 ### <a id="_samplesizecollection-n1"></a>`_.sampleSize(collection, [n=1])`
3181 <a href="#_samplesizecollection-n1">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L8956 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.samplesize "See the npm package")
3183 Gets `n` random elements at unique keys from `collection` up to the
3184 size of `collection`.
3189 1. `collection` *(Array|Object)*: The collection to sample.
3190 2. `[n=1]` *(number)*: The number of elements to sample.
3193 *(Array)*: Returns the random elements.
3197 _.sampleSize([1, 2, 3], 2);
3200 _.sampleSize([1, 2, 3], 4);
3209 ### <a id="_shufflecollection"></a>`_.shuffle(collection)`
3210 <a href="#_shufflecollection">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L8993 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.shuffle "See the npm package")
3212 Creates an array of shuffled values, using a version of the
3213 [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).
3218 1. `collection` *(Array|Object)*: The collection to shuffle.
3221 *(Array)*: Returns the new shuffled array.
3225 _.shuffle([1, 2, 3, 4]);
3234 ### <a id="_sizecollection"></a>`_.size(collection)`
3235 <a href="#_sizecollection">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L9018 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.size "See the npm package")
3237 Gets the size of `collection` by returning its length for array-like
3238 values or the number of own enumerable string keyed properties for objects.
3243 1. `collection` *(Array|Object)*: The collection to inspect.
3246 *(number)*: Returns the collection size.
3253 _.size({ 'a': 1, 'b': 2 });
3265 ### <a id="_somecollection-predicate_identity"></a>`_.some(collection, [predicate=_.identity])`
3266 <a href="#_somecollection-predicate_identity">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L9072 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.some "See the npm package")
3268 Checks if `predicate` returns truthy for **any** element of `collection`.
3269 Iteration is stopped once `predicate` returns truthy. The predicate is
3270 invoked with three arguments: *(value, index|key, collection)*.
3275 1. `collection` *(Array|Object)*: The collection to iterate over.
3276 2. `[predicate=_.identity]` *(Array|Function|Object|string)*: The function invoked per iteration.
3279 *(boolean)*: Returns `true` if any element passes the predicate check, else `false`.
3283 _.some([null, 0, 'yes', false], Boolean);
3287 { 'user': 'barney', 'active': true },
3288 { 'user': 'fred', 'active': false }
3291 // The `_.matches` iteratee shorthand.
3292 _.some(users, { 'user': 'barney', 'active': false });
3295 // The `_.matchesProperty` iteratee shorthand.
3296 _.some(users, ['active', false]);
3299 // The `_.property` iteratee shorthand.
3300 _.some(users, 'active');
3309 ### <a id="_sortbycollection-iteratees_identity"></a>`_.sortBy(collection, [iteratees=[_.identity]])`
3310 <a href="#_sortbycollection-iteratees_identity">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L9114 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.sortby "See the npm package")
3312 Creates an array of elements, sorted in ascending order by the results of
3313 running each element in a collection thru each iteratee. This method
3314 performs a stable sort, that is, it preserves the original sort order of
3315 equal elements. The iteratees are invoked with one argument: *(value)*.
3320 1. `collection` *(Array|Object)*: The collection to iterate over.
3321 2. `[iteratees=[_.identity]]` *(...(Array|Array[]|Function|Function[]|Object|Object[]|string|string[]))*: The iteratees to sort by.
3324 *(Array)*: Returns the new sorted array.
3329 { 'user': 'fred', 'age': 48 },
3330 { 'user': 'barney', 'age': 36 },
3331 { 'user': 'fred', 'age': 40 },
3332 { 'user': 'barney', 'age': 34 }
3335 _.sortBy(users, function(o) { return o.user; });
3336 // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
3338 _.sortBy(users, ['user', 'age']);
3339 // => objects for [['barney', 34], ['barney', 36], ['fred', 40], ['fred', 48]]
3341 _.sortBy(users, 'user', function(o) {
3342 return Math.floor(o.age / 10);
3344 // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
3358 ### <a id="_now"></a>`_.now()`
3359 <a href="#_now">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L9150 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.now "See the npm package")
3361 Gets the timestamp of the number of milliseconds that have elapsed since
3362 the Unix epoch *(1 January `1970 00`:00:00 UTC)*.
3367 *(number)*: Returns the timestamp.
3371 _.defer(function(stamp) {
3372 console.log(_.now() - stamp);
3374 // => Logs the number of milliseconds it took for the deferred function to be invoked.
3384 ## `“Function” Methods`
3388 ### <a id="_aftern-func"></a>`_.after(n, func)`
3389 <a href="#_aftern-func">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L9178 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.after "See the npm package")
3391 The opposite of `_.before`; this method creates a function that invokes
3392 `func` once it's called `n` or more times.
3397 1. `n` *(number)*: The number of calls before `func` is invoked.
3398 2. `func` *(Function)*: The function to restrict.
3401 *(Function)*: Returns the new restricted function.
3405 var saves = ['profile', 'settings'];
3407 var done = _.after(saves.length, function() {
3408 console.log('done saving!');
3411 _.forEach(saves, function(type) {
3412 asyncSave({ 'type': type, 'complete': done });
3414 // => Logs 'done saving!' after the two async saves have completed.
3422 ### <a id="_aryfunc-nfunclength"></a>`_.ary(func, [n=func.length])`
3423 <a href="#_aryfunc-nfunclength">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L9207 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.ary "See the npm package")
3425 Creates a function that invokes `func`, with up to `n` arguments,
3426 ignoring any additional arguments.
3431 1. `func` *(Function)*: The function to cap arguments for.
3432 2. `[n=func.length]` *(number)*: The arity cap.
3435 *(Function)*: Returns the new function.
3439 _.map(['6', '8', '10'], _.ary(parseInt, 1));
3448 ### <a id="_beforen-func"></a>`_.before(n, func)`
3449 <a href="#_beforen-func">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L9230 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.before "See the npm package")
3451 Creates a function that invokes `func`, with the `this` binding and arguments
3452 of the created function, while it's called less than `n` times. Subsequent
3453 calls to the created function return the result of the last `func` invocation.
3458 1. `n` *(number)*: The number of calls at which `func` is no longer invoked.
3459 2. `func` *(Function)*: The function to restrict.
3462 *(Function)*: Returns the new restricted function.
3466 jQuery(element).on('click', _.before(5, addContactToList));
3467 // => allows adding up to 4 contacts to the list
3475 ### <a id="_bindfunc-thisarg-partials"></a>`_.bind(func, thisArg, [partials])`
3476 <a href="#_bindfunc-thisarg-partials">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L9282 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.bind "See the npm package")
3478 Creates a function that invokes `func` with the `this` binding of `thisArg`
3479 and `partials` prepended to the arguments it receives.
3482 The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,
3483 may be used as a placeholder for partially applied arguments.
3486 **Note:** Unlike native `Function#bind` this method doesn't set the "length"
3487 property of bound functions.
3492 1. `func` *(Function)*: The function to bind.
3493 2. `thisArg` *(*)*: The `this` binding of `func`.
3494 3. `[partials]` *(...*)*: The arguments to be partially applied.
3497 *(Function)*: Returns the new bound function.
3501 var greet = function(greeting, punctuation) {
3502 return greeting + ' ' + this.user + punctuation;
3505 var object = { 'user': 'fred' };
3507 var bound = _.bind(greet, object, 'hi');
3511 // Bound with placeholders.
3512 var bound = _.bind(greet, object, _, '!');
3522 ### <a id="_bindkeyobject-key-partials"></a>`_.bindKey(object, key, [partials])`
3523 <a href="#_bindkeyobject-key-partials">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L9336 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.bindkey "See the npm package")
3525 Creates a function that invokes the method at `object[key]` with `partials`
3526 prepended to the arguments it receives.
3529 This method differs from `_.bind` by allowing bound functions to reference
3530 methods that may be redefined or don't yet exist. See
3531 [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)
3535 The `_.bindKey.placeholder` value, which defaults to `_` in monolithic
3536 builds, may be used as a placeholder for partially applied arguments.
3541 1. `object` *(Object)*: The object to invoke the method on.
3542 2. `key` *(string)*: The key of the method.
3543 3. `[partials]` *(...*)*: The arguments to be partially applied.
3546 *(Function)*: Returns the new bound function.
3552 'greet': function(greeting, punctuation) {
3553 return greeting + ' ' + this.user + punctuation;
3557 var bound = _.bindKey(object, 'greet', 'hi');
3561 object.greet = function(greeting, punctuation) {
3562 return greeting + 'ya ' + this.user + punctuation;
3568 // Bound with placeholders.
3569 var bound = _.bindKey(object, 'greet', _, '!');
3579 ### <a id="_curryfunc-arityfunclength"></a>`_.curry(func, [arity=func.length])`
3580 <a href="#_curryfunc-arityfunclength">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L9386 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.curry "See the npm package")
3582 Creates a function that accepts arguments of `func` and either invokes
3583 `func` returning its result, if at least `arity` number of arguments have
3584 been provided, or returns a function that accepts the remaining `func`
3585 arguments, and so on. The arity of `func` may be specified if `func.length`
3589 The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,
3590 may be used as a placeholder for provided arguments.
3593 **Note:** This method doesn't set the "length" property of curried functions.
3598 1. `func` *(Function)*: The function to curry.
3599 2. `[arity=func.length]` *(number)*: The arity of `func`.
3602 *(Function)*: Returns the new curried function.
3606 var abc = function(a, b, c) {
3610 var curried = _.curry(abc);
3621 // Curried with placeholders.
3622 curried(1)(_, 3)(2);
3631 ### <a id="_curryrightfunc-arityfunclength"></a>`_.curryRight(func, [arity=func.length])`
3632 <a href="#_curryrightfunc-arityfunclength">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L9431 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.curryright "See the npm package")
3634 This method is like `_.curry` except that arguments are applied to `func`
3635 in the manner of `_.partialRight` instead of `_.partial`.
3638 The `_.curryRight.placeholder` value, which defaults to `_` in monolithic
3639 builds, may be used as a placeholder for provided arguments.
3642 **Note:** This method doesn't set the "length" property of curried functions.
3647 1. `func` *(Function)*: The function to curry.
3648 2. `[arity=func.length]` *(number)*: The arity of `func`.
3651 *(Function)*: Returns the new curried function.
3655 var abc = function(a, b, c) {
3659 var curried = _.curryRight(abc);
3670 // Curried with placeholders.
3671 curried(3)(1, _)(2);
3680 ### <a id="_debouncefunc-wait0-options-optionsleadingfalse-optionsmaxwait-optionstrailingtrue"></a>`_.debounce(func, [wait=0], [options={}], [options.leading=false], [options.maxWait], [options.trailing=true])`
3681 <a href="#_debouncefunc-wait0-options-optionsleadingfalse-optionsmaxwait-optionstrailingtrue">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L9488 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.debounce "See the npm package")
3683 Creates a debounced function that delays invoking `func` until after `wait`
3684 milliseconds have elapsed since the last time the debounced function was
3685 invoked. The debounced function comes with a `cancel` method to cancel
3686 delayed `func` invocations and a `flush` method to immediately invoke them.
3687 Provide an options object to indicate whether `func` should be invoked on
3688 the leading and/or trailing edge of the `wait` timeout. The `func` is invoked
3689 with the last arguments provided to the debounced function. Subsequent calls
3690 to the debounced function return the result of the last `func` invocation.
3693 **Note:** If `leading` and `trailing` options are `true`, `func` is invoked
3694 on the trailing edge of the timeout only if the debounced function is
3695 invoked more than once during the `wait` timeout.
3698 See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
3699 for details over the differences between `_.debounce` and `_.throttle`.
3704 1. `func` *(Function)*: The function to debounce.
3705 2. `[wait=0]` *(number)*: The number of milliseconds to delay.
3706 3. `[options={}]` *(Object)*: The options object.
3707 4. `[options.leading=false]` *(boolean)*: Specify invoking on the leading edge of the timeout.
3708 5. `[options.maxWait]` *(number)*: The maximum time `func` is allowed to be delayed before it's invoked.
3709 6. `[options.trailing=true]` *(boolean)*: Specify invoking on the trailing edge of the timeout.
3712 *(Function)*: Returns the new debounced function.
3716 // Avoid costly calculations while the window size is in flux.
3717 jQuery(window).on('resize', _.debounce(calculateLayout, 150));
3719 // Invoke `sendMail` when clicked, debouncing subsequent calls.
3720 jQuery(element).on('click', _.debounce(sendMail, 300, {
3725 // Ensure `batchLog` is invoked once after 1 second of debounced calls.
3726 var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
3727 var source = new EventSource('/stream');
3728 jQuery(source).on('message', debounced);
3730 // Cancel the trailing debounced invocation.
3731 jQuery(window).on('popstate', debounced.cancel);
3739 ### <a id="_deferfunc-args"></a>`_.defer(func, [args])`
3740 <a href="#_deferfunc-args">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L9630 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.defer "See the npm package")
3742 Defers invoking the `func` until the current call stack has cleared. Any
3743 additional arguments are provided to `func` when it's invoked.
3748 1. `func` *(Function)*: The function to defer.
3749 2. `[args]` *(...*)*: The arguments to invoke `func` with.
3752 *(number)*: Returns the timer id.
3756 _.defer(function(text) {
3759 // => Logs 'deferred' after one or more milliseconds.
3767 ### <a id="_delayfunc-wait-args"></a>`_.delay(func, wait, [args])`
3768 <a href="#_delayfunc-wait-args">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L9653 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.delay "See the npm package")
3770 Invokes `func` after `wait` milliseconds. Any additional arguments are
3771 provided to `func` when it's invoked.
3776 1. `func` *(Function)*: The function to delay.
3777 2. `wait` *(number)*: The number of milliseconds to delay invocation.
3778 3. `[args]` *(...*)*: The arguments to invoke `func` with.
3781 *(number)*: Returns the timer id.
3785 _.delay(function(text) {
3788 // => Logs 'later' after one second.
3796 ### <a id="_flipfunc"></a>`_.flip(func)`
3797 <a href="#_flipfunc">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L9675 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.flip "See the npm package")
3799 Creates a function that invokes `func` with arguments reversed.
3804 1. `func` *(Function)*: The function to flip arguments for.
3807 *(Function)*: Returns the new function.
3811 var flipped = _.flip(function() {
3812 return _.toArray(arguments);
3815 flipped('a', 'b', 'c', 'd');
3816 // => ['d', 'c', 'b', 'a']
3824 ### <a id="_memoizefunc-resolver"></a>`_.memoize(func, [resolver])`
3825 <a href="#_memoizefunc-resolver">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L9723 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.memoize "See the npm package")
3827 Creates a function that memoizes the result of `func`. If `resolver` is
3828 provided, it determines the cache key for storing the result based on the
3829 arguments provided to the memoized function. By default, the first argument
3830 provided to the memoized function is used as the map cache key. The `func`
3831 is invoked with the `this` binding of the memoized function.
3834 **Note:** The cache is exposed as the `cache` property on the memoized
3835 function. Its creation may be customized by replacing the `_.memoize.Cache`
3836 constructor with one whose instances implement the
3837 [`Map`](http://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-map-prototype-object)
3838 method interface of `delete`, `get`, `has`, and `set`.
3843 1. `func` *(Function)*: The function to have its output memoized.
3844 2. `[resolver]` *(Function)*: The function to resolve the cache key.
3847 *(Function)*: Returns the new memoizing function.
3851 var object = { 'a': 1, 'b': 2 };
3852 var other = { 'c': 3, 'd': 4 };
3854 var values = _.memoize(_.values);
3865 // Modify the result cache.
3866 values.cache.set(object, ['a', 'b']);
3870 // Replace `_.memoize.Cache`.
3871 _.memoize.Cache = WeakMap;
3879 ### <a id="_negatepredicate"></a>`_.negate(predicate)`
3880 <a href="#_negatepredicate">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L9766 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.negate "See the npm package")
3882 Creates a function that negates the result of the predicate `func`. The
3883 `func` predicate is invoked with the `this` binding and arguments of the
3889 1. `predicate` *(Function)*: The predicate to negate.
3892 *(Function)*: Returns the new function.
3896 function isEven(n) {
3900 _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));
3909 ### <a id="_oncefunc"></a>`_.once(func)`
3910 <a href="#_oncefunc">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L9793 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.once "See the npm package")
3912 Creates a function that is restricted to invoking `func` once. Repeat calls
3913 to the function return the value of the first invocation. The `func` is
3914 invoked with the `this` binding and arguments of the created function.
3919 1. `func` *(Function)*: The function to restrict.
3922 *(Function)*: Returns the new restricted function.
3926 var initialize = _.once(createApplication);
3929 // `initialize` invokes `createApplication` once
3937 ### <a id="_overargsfunc"></a>`_.overArgs(func)`
3938 <a href="#_overargsfunc">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L9829 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.overargs "See the npm package")
3940 Creates a function that invokes `func` with arguments transformed by
3941 corresponding `transforms`.
3946 1. `func` *(Function)*: The function to wrap.
3949 *(Function)*: Returns the new function.
3953 function doubled(n) {
3957 function square(n) {
3961 var func = _.overArgs(function(x, y) {
3963 }, square, doubled);
3977 ### <a id="_partialfunc-partials"></a>`_.partial(func, [partials])`
3978 <a href="#_partialfunc-partials">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L9879 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.partial "See the npm package")
3980 Creates a function that invokes `func` with `partials` prepended to the
3981 arguments it receives. This method is like `_.bind` except it does **not**
3982 alter the `this` binding.
3985 The `_.partial.placeholder` value, which defaults to `_` in monolithic
3986 builds, may be used as a placeholder for partially applied arguments.
3989 **Note:** This method doesn't set the "length" property of partially
3995 1. `func` *(Function)*: The function to partially apply arguments to.
3996 2. `[partials]` *(...*)*: The arguments to be partially applied.
3999 *(Function)*: Returns the new partially applied function.
4003 var greet = function(greeting, name) {
4004 return greeting + ' ' + name;
4007 var sayHelloTo = _.partial(greet, 'hello');
4011 // Partially applied with placeholders.
4012 var greetFred = _.partial(greet, _, 'fred');
4022 ### <a id="_partialrightfunc-partials"></a>`_.partialRight(func, [partials])`
4023 <a href="#_partialrightfunc-partials">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L9916 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.partialright "See the npm package")
4025 This method is like `_.partial` except that partially applied arguments
4026 are appended to the arguments it receives.
4029 The `_.partialRight.placeholder` value, which defaults to `_` in monolithic
4030 builds, may be used as a placeholder for partially applied arguments.
4033 **Note:** This method doesn't set the "length" property of partially
4039 1. `func` *(Function)*: The function to partially apply arguments to.
4040 2. `[partials]` *(...*)*: The arguments to be partially applied.
4043 *(Function)*: Returns the new partially applied function.
4047 var greet = function(greeting, name) {
4048 return greeting + ' ' + name;
4051 var greetFred = _.partialRight(greet, 'fred');
4055 // Partially applied with placeholders.
4056 var sayHelloTo = _.partialRight(greet, 'hello', _);
4066 ### <a id="_reargfunc-indexes"></a>`_.rearg(func, indexes)`
4067 <a href="#_reargfunc-indexes">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L9943 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.rearg "See the npm package")
4069 Creates a function that invokes `func` with arguments arranged according
4070 to the specified `indexes` where the argument value at the first index is
4071 provided as the first argument, the argument value at the second index is
4072 provided as the second argument, and so on.
4077 1. `func` *(Function)*: The function to rearrange arguments for.
4078 2. `indexes` *(...(number|number[]))*: The arranged argument indexes.
4081 *(Function)*: Returns the new function.
4085 var rearged = _.rearg(function(a, b, c) {
4089 rearged('b', 'c', 'a')
4090 // => ['a', 'b', 'c']
4098 ### <a id="_restfunc-startfunclength-1"></a>`_.rest(func, [start=func.length-1])`
4099 <a href="#_restfunc-startfunclength-1">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L9972 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.rest "See the npm package")
4101 Creates a function that invokes `func` with the `this` binding of the
4102 created function and arguments from `start` and beyond provided as
4106 **Note:** This method is based on the
4107 [rest parameter](https://mdn.io/rest_parameters).
4112 1. `func` *(Function)*: The function to apply a rest parameter to.
4113 2. `[start=func.length-1]` *(number)*: The start position of the rest parameter.
4116 *(Function)*: Returns the new function.
4120 var say = _.rest(function(what, names) {
4121 return what + ' ' + _.initial(names).join(', ') +
4122 (_.size(names) > 1 ? ', & ' : '') + _.last(names);
4125 say('hello', 'fred', 'barney', 'pebbles');
4126 // => 'hello fred, barney, & pebbles'
4134 ### <a id="_spreadfunc-start0"></a>`_.spread(func, [start=0])`
4135 <a href="#_spreadfunc-start0">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10035 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.spread "See the npm package")
4137 Creates a function that invokes `func` with the `this` binding of the
4138 create function and an array of arguments much like
4139 [`Function#apply`](http://www.ecma-international.org/ecma-262/6.0/#sec-function.prototype.apply).
4142 **Note:** This method is based on the
4143 [spread operator](https://mdn.io/spread_operator).
4148 1. `func` *(Function)*: The function to spread arguments over.
4149 2. `[start=0]` *(number)*: The start position of the spread.
4152 *(Function)*: Returns the new function.
4156 var say = _.spread(function(who, what) {
4157 return who + ' says ' + what;
4160 say(['fred', 'hello']);
4161 // => 'fred says hello'
4163 var numbers = Promise.all([
4164 Promise.resolve(40),
4168 numbers.then(_.spread(function(x, y) {
4171 // => a Promise of 76
4179 ### <a id="_throttlefunc-wait0-options-optionsleadingtrue-optionstrailingtrue"></a>`_.throttle(func, [wait=0], [options={}], [options.leading=true], [options.trailing=true])`
4180 <a href="#_throttlefunc-wait0-options-optionsleadingtrue-optionstrailingtrue">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10092 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.throttle "See the npm package")
4182 Creates a throttled function that only invokes `func` at most once per
4183 every `wait` milliseconds. The throttled function comes with a `cancel`
4184 method to cancel delayed `func` invocations and a `flush` method to
4185 immediately invoke them. Provide an options object to indicate whether
4186 `func` should be invoked on the leading and/or trailing edge of the `wait`
4187 timeout. The `func` is invoked with the last arguments provided to the
4188 throttled function. Subsequent calls to the throttled function return the
4189 result of the last `func` invocation.
4192 **Note:** If `leading` and `trailing` options are `true`, `func` is
4193 invoked on the trailing edge of the timeout only if the throttled function
4194 is invoked more than once during the `wait` timeout.
4197 See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
4198 for details over the differences between `_.throttle` and `_.debounce`.
4203 1. `func` *(Function)*: The function to throttle.
4204 2. `[wait=0]` *(number)*: The number of milliseconds to throttle invocations to.
4205 3. `[options={}]` *(Object)*: The options object.
4206 4. `[options.leading=true]` *(boolean)*: Specify invoking on the leading edge of the timeout.
4207 5. `[options.trailing=true]` *(boolean)*: Specify invoking on the trailing edge of the timeout.
4210 *(Function)*: Returns the new throttled function.
4214 // Avoid excessively updating the position while scrolling.
4215 jQuery(window).on('scroll', _.throttle(updatePosition, 100));
4217 // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.
4218 var throttled = _.throttle(renewToken, 300000, { 'trailing': false });
4219 jQuery(element).on('click', throttled);
4221 // Cancel the trailing throttled invocation.
4222 jQuery(window).on('popstate', throttled.cancel);
4230 ### <a id="_unaryfunc"></a>`_.unary(func)`
4231 <a href="#_unaryfunc">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10125 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.unary "See the npm package")
4233 Creates a function that accepts up to one argument, ignoring any
4234 additional arguments.
4239 1. `func` *(Function)*: The function to cap arguments for.
4242 *(Function)*: Returns the new function.
4246 _.map(['6', '8', '10'], _.unary(parseInt));
4255 ### <a id="_wrapvalue-wrapperidentity"></a>`_.wrap(value, [wrapper=identity])`
4256 <a href="#_wrapvalue-wrapperidentity">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10151 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.wrap "See the npm package")
4258 Creates a function that provides `value` to the wrapper function as its
4259 first argument. Any additional arguments provided to the function are
4260 appended to those provided to the wrapper function. The wrapper is invoked
4261 with the `this` binding of the created function.
4266 1. `value` *(*)*: The value to wrap.
4267 2. `[wrapper=identity]` *(Function)*: The wrapper function.
4270 *(Function)*: Returns the new function.
4274 var p = _.wrap(_.escape, function(func, text) {
4275 return '<p>' + func(text) + '</p>';
4278 p('fred, barney, & pebbles');
4279 // => '<p>fred, barney, & pebbles</p>'
4293 ### <a id="_castarrayvalue"></a>`_.castArray(value)`
4294 <a href="#_castarrayvalue">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10191 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.castarray "See the npm package")
4296 Casts `value` as an array if it's not one.
4301 1. `value` *(*)*: The value to inspect.
4304 *(Array)*: Returns the cast array.
4311 _.castArray({ 'a': 1 });
4320 _.castArray(undefined);
4326 var array = [1, 2, 3];
4327 console.log(_.castArray(array) === array);
4336 ### <a id="_clonevalue"></a>`_.clone(value)`
4337 <a href="#_clonevalue">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10225 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.clone "See the npm package")
4339 Creates a shallow clone of `value`.
4342 **Note:** This method is loosely based on the
4343 [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)
4344 and supports cloning arrays, array buffers, booleans, date objects, maps,
4345 numbers, `Object` objects, regexes, sets, strings, symbols, and typed
4346 arrays. The own enumerable properties of `arguments` objects are cloned
4347 as plain objects. An empty object is returned for uncloneable values such
4348 as error objects, functions, DOM nodes, and WeakMaps.
4353 1. `value` *(*)*: The value to clone.
4356 *(*)*: Returns the cloned value.
4360 var objects = [{ 'a': 1 }, { 'b': 2 }];
4362 var shallow = _.clone(objects);
4363 console.log(shallow[0] === objects[0]);
4372 ### <a id="_clonedeepvalue"></a>`_.cloneDeep(value)`
4373 <a href="#_clonedeepvalue">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10282 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.clonedeep "See the npm package")
4375 This method is like `_.clone` except that it recursively clones `value`.
4380 1. `value` *(*)*: The value to recursively clone.
4383 *(*)*: Returns the deep cloned value.
4387 var objects = [{ 'a': 1 }, { 'b': 2 }];
4389 var deep = _.cloneDeep(objects);
4390 console.log(deep[0] === objects[0]);
4399 ### <a id="_clonedeepwithvalue-customizer"></a>`_.cloneDeepWith(value, [customizer])`
4400 <a href="#_clonedeepwithvalue-customizer">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10314 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.clonedeepwith "See the npm package")
4402 This method is like `_.cloneWith` except that it recursively clones `value`.
4407 1. `value` *(*)*: The value to recursively clone.
4408 2. `[customizer]` *(Function)*: The function to customize cloning.
4411 *(*)*: Returns the deep cloned value.
4415 function customizer(value) {
4416 if (_.isElement(value)) {
4417 return value.cloneNode(true);
4421 var el = _.cloneDeepWith(document.body, customizer);
4423 console.log(el === document.body);
4425 console.log(el.nodeName);
4427 console.log(el.childNodes.length);
4436 ### <a id="_clonewithvalue-customizer"></a>`_.cloneWith(value, [customizer])`
4437 <a href="#_clonewithvalue-customizer">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10260 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.clonewith "See the npm package")
4439 This method is like `_.clone` except that it accepts `customizer` which
4440 is invoked to produce the cloned value. If `customizer` returns `undefined`,
4441 cloning is handled by the method instead. The `customizer` is invoked with
4442 up to four arguments; *(value [, index|key, object, stack])*.
4447 1. `value` *(*)*: The value to clone.
4448 2. `[customizer]` *(Function)*: The function to customize cloning.
4451 *(*)*: Returns the cloned value.
4455 function customizer(value) {
4456 if (_.isElement(value)) {
4457 return value.cloneNode(false);
4461 var el = _.cloneWith(document.body, customizer);
4463 console.log(el === document.body);
4465 console.log(el.nodeName);
4467 console.log(el.childNodes.length);
4476 ### <a id="_eqvalue-other"></a>`_.eq(value, other)`
4477 <a href="#_eqvalue-other">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10350 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.eq "See the npm package")
4480 [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
4481 comparison between two values to determine if they are equivalent.
4486 1. `value` *(*)*: The value to compare.
4487 2. `other` *(*)*: The other value to compare.
4490 *(boolean)*: Returns `true` if the values are equivalent, else `false`.
4494 var object = { 'user': 'fred' };
4495 var other = { 'user': 'fred' };
4497 _.eq(object, object);
4500 _.eq(object, other);
4506 _.eq('a', Object('a'));
4518 ### <a id="_gtvalue-other"></a>`_.gt(value, other)`
4519 <a href="#_gtvalue-other">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10377 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.gt "See the npm package")
4521 Checks if `value` is greater than `other`.
4526 1. `value` *(*)*: The value to compare.
4527 2. `other` *(*)*: The other value to compare.
4530 *(boolean)*: Returns `true` if `value` is greater than `other`, else `false`.
4549 ### <a id="_gtevalue-other"></a>`_.gte(value, other)`
4550 <a href="#_gtevalue-other">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10402 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.gte "See the npm package")
4552 Checks if `value` is greater than or equal to `other`.
4557 1. `value` *(*)*: The value to compare.
4558 2. `other` *(*)*: The other value to compare.
4561 *(boolean)*: Returns `true` if `value` is greater than or equal to `other`, else `false`.
4580 ### <a id="_isargumentsvalue"></a>`_.isArguments(value)`
4581 <a href="#_isargumentsvalue">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10424 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isarguments "See the npm package")
4583 Checks if `value` is likely an `arguments` object.
4588 1. `value` *(*)*: The value to check.
4591 *(boolean)*: Returns `true` if `value` is correctly classified, else `false`.
4595 _.isArguments(function() { return arguments; }());
4598 _.isArguments([1, 2, 3]);
4607 ### <a id="_isarrayvalue"></a>`_.isArray(value)`
4608 <a href="#_isarrayvalue">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10455 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isarray "See the npm package")
4610 Checks if `value` is classified as an `Array` object.
4615 1. `value` *(*)*: The value to check.
4618 *(boolean)*: Returns `true` if `value` is correctly classified, else `false`.
4622 _.isArray([1, 2, 3]);
4625 _.isArray(document.body.children);
4640 ### <a id="_isarraybuffervalue"></a>`_.isArrayBuffer(value)`
4641 <a href="#_isarraybuffervalue">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10475 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isarraybuffer "See the npm package")
4643 Checks if `value` is classified as an `ArrayBuffer` object.
4648 1. `value` *(*)*: The value to check.
4651 *(boolean)*: Returns `true` if `value` is correctly classified, else `false`.
4655 _.isArrayBuffer(new ArrayBuffer(2));
4658 _.isArrayBuffer(new Array(2));
4667 ### <a id="_isarraylikevalue"></a>`_.isArrayLike(value)`
4668 <a href="#_isarraylikevalue">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10504 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isarraylike "See the npm package")
4670 Checks if `value` is array-like. A value is considered array-like if it's
4671 not a function and has a `value.length` that's an integer greater than or
4672 equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
4677 1. `value` *(*)*: The value to check.
4680 *(boolean)*: Returns `true` if `value` is array-like, else `false`.
4684 _.isArrayLike([1, 2, 3]);
4687 _.isArrayLike(document.body.children);
4690 _.isArrayLike('abc');
4693 _.isArrayLike(_.noop);
4702 ### <a id="_isarraylikeobjectvalue"></a>`_.isArrayLikeObject(value)`
4703 <a href="#_isarraylikeobjectvalue">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10533 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isarraylikeobject "See the npm package")
4705 This method is like `_.isArrayLike` except that it also checks if `value`
4711 1. `value` *(*)*: The value to check.
4714 *(boolean)*: Returns `true` if `value` is an array-like object, else `false`.
4718 _.isArrayLikeObject([1, 2, 3]);
4721 _.isArrayLikeObject(document.body.children);
4724 _.isArrayLikeObject('abc');
4727 _.isArrayLikeObject(_.noop);
4736 ### <a id="_isbooleanvalue"></a>`_.isBoolean(value)`
4737 <a href="#_isbooleanvalue">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10555 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isboolean "See the npm package")
4739 Checks if `value` is classified as a boolean primitive or object.
4744 1. `value` *(*)*: The value to check.
4747 *(boolean)*: Returns `true` if `value` is correctly classified, else `false`.
4763 ### <a id="_isbuffervalue"></a>`_.isBuffer(value)`
4764 <a href="#_isbuffervalue">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10577 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isbuffer "See the npm package")
4766 Checks if `value` is a buffer.
4771 1. `value` *(*)*: The value to check.
4774 *(boolean)*: Returns `true` if `value` is a buffer, else `false`.
4778 _.isBuffer(new Buffer(2));
4781 _.isBuffer(new Uint8Array(2));
4790 ### <a id="_isdatevalue"></a>`_.isDate(value)`
4791 <a href="#_isdatevalue">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10599 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isdate "See the npm package")
4793 Checks if `value` is classified as a `Date` object.
4798 1. `value` *(*)*: The value to check.
4801 *(boolean)*: Returns `true` if `value` is correctly classified, else `false`.
4808 _.isDate('Mon April 23 2012');
4817 ### <a id="_iselementvalue"></a>`_.isElement(value)`
4818 <a href="#_iselementvalue">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10621 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.iselement "See the npm package")
4820 Checks if `value` is likely a DOM element.
4825 1. `value` *(*)*: The value to check.
4828 *(boolean)*: Returns `true` if `value` is a DOM element, else `false`.
4832 _.isElement(document.body);
4835 _.isElement('<body>');
4844 ### <a id="_isemptyvalue"></a>`_.isEmpty(value)`
4845 <a href="#_isemptyvalue">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10658 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isempty "See the npm package")
4847 Checks if `value` is an empty object, collection, map, or set.
4850 Objects are considered empty if they have no own enumerable string keyed
4854 Array-like values such as `arguments` objects, arrays, buffers, strings, or
4855 jQuery-like collections are considered empty if they have a `length` of `0`.
4856 Similarly, maps and sets are considered empty if they have a `size` of `0`.
4861 1. `value` *(*)*: The value to check.
4864 *(boolean)*: Returns `true` if `value` is empty, else `false`.
4877 _.isEmpty([1, 2, 3]);
4880 _.isEmpty({ 'a': 1 });
4889 ### <a id="_isequalvalue-other"></a>`_.isEqual(value, other)`
4890 <a href="#_isequalvalue-other">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10707 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isequal "See the npm package")
4892 Performs a deep comparison between two values to determine if they are
4896 **Note:** This method supports comparing arrays, array buffers, booleans,
4897 date objects, error objects, maps, numbers, `Object` objects, regexes,
4898 sets, strings, symbols, and typed arrays. `Object` objects are compared
4899 by their own, not inherited, enumerable properties. Functions and DOM
4900 nodes are **not** supported.
4905 1. `value` *(*)*: The value to compare.
4906 2. `other` *(*)*: The other value to compare.
4909 *(boolean)*: Returns `true` if the values are equivalent, else `false`.
4913 var object = { 'user': 'fred' };
4914 var other = { 'user': 'fred' };
4916 _.isEqual(object, other);
4928 ### <a id="_isequalwithvalue-other-customizer"></a>`_.isEqualWith(value, other, [customizer])`
4929 <a href="#_isequalwithvalue-other-customizer">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10744 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isequalwith "See the npm package")
4931 This method is like `_.isEqual` except that it accepts `customizer` which
4932 is invoked to compare values. If `customizer` returns `undefined`, comparisons
4933 are handled by the method instead. The `customizer` is invoked with up to
4934 six arguments: *(objValue, othValue [, index|key, object, other, stack])*.
4939 1. `value` *(*)*: The value to compare.
4940 2. `other` *(*)*: The other value to compare.
4941 3. `[customizer]` *(Function)*: The function to customize comparisons.
4944 *(boolean)*: Returns `true` if the values are equivalent, else `false`.
4948 function isGreeting(value) {
4949 return /^h(?:i|ello)$/.test(value);
4952 function customizer(objValue, othValue) {
4953 if (isGreeting(objValue) && isGreeting(othValue)) {
4958 var array = ['hello', 'goodbye'];
4959 var other = ['hi', 'goodbye'];
4961 _.isEqualWith(array, other, customizer);
4970 ### <a id="_iserrorvalue"></a>`_.isError(value)`
4971 <a href="#_iserrorvalue">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10769 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.iserror "See the npm package")
4973 Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,
4974 `SyntaxError`, `TypeError`, or `URIError` object.
4979 1. `value` *(*)*: The value to check.
4982 *(boolean)*: Returns `true` if `value` is an error object, else `false`.
4986 _.isError(new Error);
4998 ### <a id="_isfinitevalue"></a>`_.isFinite(value)`
4999 <a href="#_isfinitevalue">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10804 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isfinite "See the npm package")
5001 Checks if `value` is a finite primitive number.
5004 **Note:** This method is based on
5005 [`Number.isFinite`](https://mdn.io/Number/isFinite).
5010 1. `value` *(*)*: The value to check.
5013 *(boolean)*: Returns `true` if `value` is a finite number, else `false`.
5020 _.isFinite(Number.MAX_VALUE);
5026 _.isFinite(Infinity);
5035 ### <a id="_isfunctionvalue"></a>`_.isFunction(value)`
5036 <a href="#_isfunctionvalue">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10826 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isfunction "See the npm package")
5038 Checks if `value` is classified as a `Function` object.
5043 1. `value` *(*)*: The value to check.
5046 *(boolean)*: Returns `true` if `value` is correctly classified, else `false`.
5053 _.isFunction(/abc/);
5062 ### <a id="_isintegervalue"></a>`_.isInteger(value)`
5063 <a href="#_isintegervalue">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10860 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isinteger "See the npm package")
5065 Checks if `value` is an integer.
5068 **Note:** This method is based on
5069 [`Number.isInteger`](https://mdn.io/Number/isInteger).
5074 1. `value` *(*)*: The value to check.
5077 *(boolean)*: Returns `true` if `value` is an integer, else `false`.
5084 _.isInteger(Number.MIN_VALUE);
5087 _.isInteger(Infinity);
5099 ### <a id="_islengthvalue"></a>`_.isLength(value)`
5100 <a href="#_islengthvalue">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10891 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.islength "See the npm package")
5102 Checks if `value` is a valid array-like length.
5105 **Note:** This function is loosely based on
5106 [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength).
5111 1. `value` *(*)*: The value to check.
5114 *(boolean)*: Returns `true` if `value` is a valid length, else `false`.
5121 _.isLength(Number.MIN_VALUE);
5124 _.isLength(Infinity);
5136 ### <a id="_ismapvalue"></a>`_.isMap(value)`
5137 <a href="#_ismapvalue">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10972 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.ismap "See the npm package")
5139 Checks if `value` is classified as a `Map` object.
5144 1. `value` *(*)*: The value to check.
5147 *(boolean)*: Returns `true` if `value` is correctly classified, else `false`.
5154 _.isMap(new WeakMap);
5163 ### <a id="_ismatchobject-source"></a>`_.isMatch(object, source)`
5164 <a href="#_ismatchobject-source">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11000 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.ismatch "See the npm package")
5166 Performs a partial deep comparison between `object` and `source` to
5167 determine if `object` contains equivalent property values. This method is
5168 equivalent to a `_.matches` function when `source` is partially applied.
5171 **Note:** This method supports comparing the same values as `_.isEqual`.
5176 1. `object` *(Object)*: The object to inspect.
5177 2. `source` *(Object)*: The object of property values to match.
5180 *(boolean)*: Returns `true` if `object` is a match, else `false`.
5184 var object = { 'user': 'fred', 'age': 40 };
5186 _.isMatch(object, { 'age': 40 });
5189 _.isMatch(object, { 'age': 36 });
5198 ### <a id="_ismatchwithobject-source-customizer"></a>`_.isMatchWith(object, source, [customizer])`
5199 <a href="#_ismatchwithobject-source-customizer">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11036 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.ismatchwith "See the npm package")
5201 This method is like `_.isMatch` except that it accepts `customizer` which
5202 is invoked to compare values. If `customizer` returns `undefined`, comparisons
5203 are handled by the method instead. The `customizer` is invoked with five
5204 arguments: *(objValue, srcValue, index|key, object, source)*.
5209 1. `object` *(Object)*: The object to inspect.
5210 2. `source` *(Object)*: The object of property values to match.
5211 3. `[customizer]` *(Function)*: The function to customize comparisons.
5214 *(boolean)*: Returns `true` if `object` is a match, else `false`.
5218 function isGreeting(value) {
5219 return /^h(?:i|ello)$/.test(value);
5222 function customizer(objValue, srcValue) {
5223 if (isGreeting(objValue) && isGreeting(srcValue)) {
5228 var object = { 'greeting': 'hello' };
5229 var source = { 'greeting': 'hi' };
5231 _.isMatchWith(object, source, customizer);
5240 ### <a id="_isnanvalue"></a>`_.isNaN(value)`
5241 <a href="#_isnanvalue">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11069 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isnan "See the npm package")
5243 Checks if `value` is `NaN`.
5246 **Note:** This method is based on
5247 [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as
5248 global [`isNaN`](https://mdn.io/isNaN) which returns `true` for
5249 `undefined` and other non-number values.
5254 1. `value` *(*)*: The value to check.
5257 *(boolean)*: Returns `true` if `value` is `NaN`, else `false`.
5264 _.isNaN(new Number(NaN));
5279 ### <a id="_isnativevalue"></a>`_.isNative(value)`
5280 <a href="#_isnativevalue">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11094 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isnative "See the npm package")
5282 Checks if `value` is a native function.
5287 1. `value` *(*)*: The value to check.
5290 *(boolean)*: Returns `true` if `value` is a native function, else `false`.
5294 _.isNative(Array.prototype.push);
5306 ### <a id="_isnilvalue"></a>`_.isNil(value)`
5307 <a href="#_isnilvalue">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11143 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isnil "See the npm package")
5309 Checks if `value` is `null` or `undefined`.
5314 1. `value` *(*)*: The value to check.
5317 *(boolean)*: Returns `true` if `value` is nullish, else `false`.
5336 ### <a id="_isnullvalue"></a>`_.isNull(value)`
5337 <a href="#_isnullvalue">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11119 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isnull "See the npm package")
5339 Checks if `value` is `null`.
5344 1. `value` *(*)*: The value to check.
5347 *(boolean)*: Returns `true` if `value` is `null`, else `false`.
5363 ### <a id="_isnumbervalue"></a>`_.isNumber(value)`
5364 <a href="#_isnumbervalue">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11174 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isnumber "See the npm package")
5366 Checks if `value` is classified as a `Number` primitive or object.
5369 **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are
5370 classified as numbers, use the `_.isFinite` method.
5375 1. `value` *(*)*: The value to check.
5378 *(boolean)*: Returns `true` if `value` is correctly classified, else `false`.
5385 _.isNumber(Number.MIN_VALUE);
5388 _.isNumber(Infinity);
5400 ### <a id="_isobjectvalue"></a>`_.isObject(value)`
5401 <a href="#_isobjectvalue">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10921 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isobject "See the npm package")
5403 Checks if `value` is the
5404 [language type](http://www.ecma-international.org/ecma-262/6.0/#sec-ecmascript-language-types)
5405 of `Object`. *(e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)*
5410 1. `value` *(*)*: The value to check.
5413 *(boolean)*: Returns `true` if `value` is an object, else `false`.
5420 _.isObject([1, 2, 3]);
5435 ### <a id="_isobjectlikevalue"></a>`_.isObjectLike(value)`
5436 <a href="#_isobjectlikevalue">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10950 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isobjectlike "See the npm package")
5438 Checks if `value` is object-like. A value is object-like if it's not `null`
5439 and has a `typeof` result of "object".
5444 1. `value` *(*)*: The value to check.
5447 *(boolean)*: Returns `true` if `value` is object-like, else `false`.
5454 _.isObjectLike([1, 2, 3]);
5457 _.isObjectLike(_.noop);
5460 _.isObjectLike(null);
5469 ### <a id="_isplainobjectvalue"></a>`_.isPlainObject(value)`
5470 <a href="#_isplainobjectvalue">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11208 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isplainobject "See the npm package")
5472 Checks if `value` is a plain object, that is, an object created by the
5473 `Object` constructor or one with a `[[Prototype]]` of `null`.
5478 1. `value` *(*)*: The value to check.
5481 *(boolean)*: Returns `true` if `value` is a plain object, else `false`.
5489 _.isPlainObject(new Foo);
5492 _.isPlainObject([1, 2, 3]);
5495 _.isPlainObject({ 'x': 0, 'y': 0 });
5498 _.isPlainObject(Object.create(null));
5507 ### <a id="_isregexpvalue"></a>`_.isRegExp(value)`
5508 <a href="#_isregexpvalue">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11240 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isregexp "See the npm package")
5510 Checks if `value` is classified as a `RegExp` object.
5515 1. `value` *(*)*: The value to check.
5518 *(boolean)*: Returns `true` if `value` is correctly classified, else `false`.
5525 _.isRegExp('/abc/');
5534 ### <a id="_issafeintegervalue"></a>`_.isSafeInteger(value)`
5535 <a href="#_issafeintegervalue">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11272 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.issafeinteger "See the npm package")
5537 Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754
5538 double precision number which isn't the result of a rounded unsafe integer.
5541 **Note:** This method is based on
5542 [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger).
5547 1. `value` *(*)*: The value to check.
5550 *(boolean)*: Returns `true` if `value` is a safe integer, else `false`.
5557 _.isSafeInteger(Number.MIN_VALUE);
5560 _.isSafeInteger(Infinity);
5563 _.isSafeInteger('3');
5572 ### <a id="_issetvalue"></a>`_.isSet(value)`
5573 <a href="#_issetvalue">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11294 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isset "See the npm package")
5575 Checks if `value` is classified as a `Set` object.
5580 1. `value` *(*)*: The value to check.
5583 *(boolean)*: Returns `true` if `value` is correctly classified, else `false`.
5590 _.isSet(new WeakSet);
5599 ### <a id="_isstringvalue"></a>`_.isString(value)`
5600 <a href="#_isstringvalue">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11316 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isstring "See the npm package")
5602 Checks if `value` is classified as a `String` primitive or object.
5607 1. `value` *(*)*: The value to check.
5610 *(boolean)*: Returns `true` if `value` is correctly classified, else `false`.
5626 ### <a id="_issymbolvalue"></a>`_.isSymbol(value)`
5627 <a href="#_issymbolvalue">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11339 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.issymbol "See the npm package")
5629 Checks if `value` is classified as a `Symbol` primitive or object.
5634 1. `value` *(*)*: The value to check.
5637 *(boolean)*: Returns `true` if `value` is correctly classified, else `false`.
5641 _.isSymbol(Symbol.iterator);
5653 ### <a id="_istypedarrayvalue"></a>`_.isTypedArray(value)`
5654 <a href="#_istypedarrayvalue">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11362 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.istypedarray "See the npm package")
5656 Checks if `value` is classified as a typed array.
5661 1. `value` *(*)*: The value to check.
5664 *(boolean)*: Returns `true` if `value` is correctly classified, else `false`.
5668 _.isTypedArray(new Uint8Array);
5680 ### <a id="_isundefinedvalue"></a>`_.isUndefined(value)`
5681 <a href="#_isundefinedvalue">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11384 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isundefined "See the npm package")
5683 Checks if `value` is `undefined`.
5688 1. `value` *(*)*: The value to check.
5691 *(boolean)*: Returns `true` if `value` is `undefined`, else `false`.
5695 _.isUndefined(void 0);
5698 _.isUndefined(null);
5707 ### <a id="_isweakmapvalue"></a>`_.isWeakMap(value)`
5708 <a href="#_isweakmapvalue">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11406 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isweakmap "See the npm package")
5710 Checks if `value` is classified as a `WeakMap` object.
5715 1. `value` *(*)*: The value to check.
5718 *(boolean)*: Returns `true` if `value` is correctly classified, else `false`.
5722 _.isWeakMap(new WeakMap);
5725 _.isWeakMap(new Map);
5734 ### <a id="_isweaksetvalue"></a>`_.isWeakSet(value)`
5735 <a href="#_isweaksetvalue">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11428 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.isweakset "See the npm package")
5737 Checks if `value` is classified as a `WeakSet` object.
5742 1. `value` *(*)*: The value to check.
5745 *(boolean)*: Returns `true` if `value` is correctly classified, else `false`.
5749 _.isWeakSet(new WeakSet);
5752 _.isWeakSet(new Set);
5761 ### <a id="_ltvalue-other"></a>`_.lt(value, other)`
5762 <a href="#_ltvalue-other">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11455 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.lt "See the npm package")
5764 Checks if `value` is less than `other`.
5769 1. `value` *(*)*: The value to compare.
5770 2. `other` *(*)*: The other value to compare.
5773 *(boolean)*: Returns `true` if `value` is less than `other`, else `false`.
5792 ### <a id="_ltevalue-other"></a>`_.lte(value, other)`
5793 <a href="#_ltevalue-other">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11480 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.lte "See the npm package")
5795 Checks if `value` is less than or equal to `other`.
5800 1. `value` *(*)*: The value to compare.
5801 2. `other` *(*)*: The other value to compare.
5804 *(boolean)*: Returns `true` if `value` is less than or equal to `other`, else `false`.
5823 ### <a id="_toarrayvalue"></a>`_.toArray(value)`
5824 <a href="#_toarrayvalue">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11507 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.toarray "See the npm package")
5826 Converts `value` to an array.
5831 1. `value` *(*)*: The value to convert.
5834 *(Array)*: Returns the converted array.
5838 _.toArray({ 'a': 1, 'b': 2 });
5842 // => ['a', 'b', 'c']
5856 ### <a id="_tointegervalue"></a>`_.toInteger(value)`
5857 <a href="#_tointegervalue">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11549 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.tointeger "See the npm package")
5859 Converts `value` to an integer.
5862 **Note:** This function is loosely based on
5863 [`ToInteger`](http://www.ecma-international.org/ecma-262/6.0/#sec-tointeger).
5868 1. `value` *(*)*: The value to convert.
5871 *(number)*: Returns the converted integer.
5878 _.toInteger(Number.MIN_VALUE);
5881 _.toInteger(Infinity);
5882 // => 1.7976931348623157e+308
5893 ### <a id="_tolengthvalue"></a>`_.toLength(value)`
5894 <a href="#_tolengthvalue">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11589 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.tolength "See the npm package")
5896 Converts `value` to an integer suitable for use as the length of an
5900 **Note:** This method is based on
5901 [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength).
5906 1. `value` *(*)*: The value to convert.
5909 *(number)*: Returns the converted integer.
5916 _.toLength(Number.MIN_VALUE);
5919 _.toLength(Infinity);
5931 ### <a id="_tonumbervalue"></a>`_.toNumber(value)`
5932 <a href="#_tonumbervalue">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11616 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.tonumber "See the npm package")
5934 Converts `value` to a number.
5939 1. `value` *(*)*: The value to process.
5942 *(number)*: Returns the number.
5949 _.toNumber(Number.MIN_VALUE);
5952 _.toNumber(Infinity);
5964 ### <a id="_toplainobjectvalue"></a>`_.toPlainObject(value)`
5965 <a href="#_toplainobjectvalue">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11661 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.toplainobject "See the npm package")
5967 Converts `value` to a plain object flattening inherited enumerable string
5968 keyed properties of `value` to own properties of the plain object.
5973 1. `value` *(*)*: The value to convert.
5976 *(Object)*: Returns the converted plain object.
5984 Foo.prototype.c = 3;
5986 _.assign({ 'a': 1 }, new Foo);
5987 // => { 'a': 1, 'b': 2 }
5989 _.assign({ 'a': 1 }, _.toPlainObject(new Foo));
5990 // => { 'a': 1, 'b': 2, 'c': 3 }
5998 ### <a id="_tosafeintegervalue"></a>`_.toSafeInteger(value)`
5999 <a href="#_tosafeintegervalue">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11689 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.tosafeinteger "See the npm package")
6001 Converts `value` to a safe integer. A safe integer can be compared and
6002 represented correctly.
6007 1. `value` *(*)*: The value to convert.
6010 *(number)*: Returns the converted integer.
6017 _.toSafeInteger(Number.MIN_VALUE);
6020 _.toSafeInteger(Infinity);
6021 // => 9007199254740991
6023 _.toSafeInteger('3');
6032 ### <a id="_tostringvalue"></a>`_.toString(value)`
6033 <a href="#_tostringvalue">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11714 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.tostring "See the npm package")
6035 Converts `value` to a string. An empty string is returned for `null`
6036 and `undefined` values. The sign of `-0` is preserved.
6041 1. `value` *(*)*: The value to process.
6044 *(string)*: Returns the string.
6054 _.toString([1, 2, 3]);
6069 ### <a id="_addaugend-addend"></a>`_.add(augend, addend)`
6070 <a href="#_addaugend-addend">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L15229 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.add "See the npm package")
6077 1. `augend` *(number)*: The first number in an addition.
6078 2. `addend` *(number)*: The second number in an addition.
6081 *(number)*: Returns the total.
6094 ### <a id="_ceilnumber-precision0"></a>`_.ceil(number, [precision=0])`
6095 <a href="#_ceilnumber-precision0">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L15254 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.ceil "See the npm package")
6097 Computes `number` rounded up to `precision`.
6102 1. `number` *(number)*: The number to round up.
6103 2. `[precision=0]` *(number)*: The precision to round up to.
6106 *(number)*: Returns the rounded up number.
6125 ### <a id="_dividedividend-divisor"></a>`_.divide(dividend, divisor)`
6126 <a href="#_dividedividend-divisor">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L15271 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.divide "See the npm package")
6133 1. `dividend` *(number)*: The first number in a division.
6134 2. `divisor` *(number)*: The second number in a division.
6137 *(number)*: Returns the quotient.
6150 ### <a id="_floornumber-precision0"></a>`_.floor(number, [precision=0])`
6151 <a href="#_floornumber-precision0">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L15296 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.floor "See the npm package")
6153 Computes `number` rounded down to `precision`.
6158 1. `number` *(number)*: The number to round down.
6159 2. `[precision=0]` *(number)*: The precision to round down to.
6162 *(number)*: Returns the rounded down number.
6181 ### <a id="_maxarray"></a>`_.max(array)`
6182 <a href="#_maxarray">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L15316 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.max "See the npm package")
6184 Computes the maximum value of `array`. If `array` is empty or falsey,
6185 `undefined` is returned.
6190 1. `array` *(Array)*: The array to iterate over.
6193 *(*)*: Returns the maximum value.
6197 _.max([4, 2, 8, 6]);
6209 ### <a id="_maxbyarray-iteratee_identity"></a>`_.maxBy(array, [iteratee=_.identity])`
6210 <a href="#_maxbyarray-iteratee_identity">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L15346 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.maxby "See the npm package")
6212 This method is like `_.max` except that it accepts `iteratee` which is
6213 invoked for each element in `array` to generate the criterion by which
6214 the value is ranked. The iteratee is invoked with one argument: *(value)*.
6219 1. `array` *(Array)*: The array to iterate over.
6220 2. `[iteratee=_.identity]` *(Array|Function|Object|string)*: The iteratee invoked per element.
6223 *(*)*: Returns the maximum value.
6227 var objects = [{ 'n': 1 }, { 'n': 2 }];
6229 _.maxBy(objects, function(o) { return o.n; });
6232 // The `_.property` iteratee shorthand.
6233 _.maxBy(objects, 'n');
6242 ### <a id="_meanarray"></a>`_.mean(array)`
6243 <a href="#_meanarray">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L15366 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.mean "See the npm package")
6245 Computes the mean of the values in `array`.
6250 1. `array` *(Array)*: The array to iterate over.
6253 *(number)*: Returns the mean.
6257 _.mean([4, 2, 8, 6]);
6266 ### <a id="_meanbyarray-iteratee_identity"></a>`_.meanBy(array, [iteratee=_.identity])`
6267 <a href="#_meanbyarray-iteratee_identity">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L15394 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.meanby "See the npm package")
6269 This method is like `_.mean` except that it accepts `iteratee` which is
6270 invoked for each element in `array` to generate the value to be averaged.
6271 The iteratee is invoked with one argument: *(value)*.
6276 1. `array` *(Array)*: The array to iterate over.
6277 2. `[iteratee=_.identity]` *(Array|Function|Object|string)*: The iteratee invoked per element.
6280 *(number)*: Returns the mean.
6284 var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
6286 _.meanBy(objects, function(o) { return o.n; });
6289 // The `_.property` iteratee shorthand.
6290 _.meanBy(objects, 'n');
6299 ### <a id="_minarray"></a>`_.min(array)`
6300 <a href="#_minarray">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L15416 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.min "See the npm package")
6302 Computes the minimum value of `array`. If `array` is empty or falsey,
6303 `undefined` is returned.
6308 1. `array` *(Array)*: The array to iterate over.
6311 *(*)*: Returns the minimum value.
6315 _.min([4, 2, 8, 6]);
6327 ### <a id="_minbyarray-iteratee_identity"></a>`_.minBy(array, [iteratee=_.identity])`
6328 <a href="#_minbyarray-iteratee_identity">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L15446 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.minby "See the npm package")
6330 This method is like `_.min` except that it accepts `iteratee` which is
6331 invoked for each element in `array` to generate the criterion by which
6332 the value is ranked. The iteratee is invoked with one argument: *(value)*.
6337 1. `array` *(Array)*: The array to iterate over.
6338 2. `[iteratee=_.identity]` *(Array|Function|Object|string)*: The iteratee invoked per element.
6341 *(*)*: Returns the minimum value.
6345 var objects = [{ 'n': 1 }, { 'n': 2 }];
6347 _.minBy(objects, function(o) { return o.n; });
6350 // The `_.property` iteratee shorthand.
6351 _.minBy(objects, 'n');
6360 ### <a id="_multiplymultiplier-multiplicand"></a>`_.multiply(multiplier, multiplicand)`
6361 <a href="#_multiplymultiplier-multiplicand">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L15467 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.multiply "See the npm package")
6363 Multiply two numbers.
6368 1. `multiplier` *(number)*: The first number in a multiplication.
6369 2. `multiplicand` *(number)*: The second number in a multiplication.
6372 *(number)*: Returns the product.
6385 ### <a id="_roundnumber-precision0"></a>`_.round(number, [precision=0])`
6386 <a href="#_roundnumber-precision0">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L15492 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.round "See the npm package")
6388 Computes `number` rounded to `precision`.
6393 1. `number` *(number)*: The number to round.
6394 2. `[precision=0]` *(number)*: The precision to round to.
6397 *(number)*: Returns the rounded number.
6416 ### <a id="_subtractminuend-subtrahend"></a>`_.subtract(minuend, subtrahend)`
6417 <a href="#_subtractminuend-subtrahend">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L15509 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.subtract "See the npm package")
6419 Subtract two numbers.
6424 1. `minuend` *(number)*: The first number in a subtraction.
6425 2. `subtrahend` *(number)*: The second number in a subtraction.
6428 *(number)*: Returns the difference.
6441 ### <a id="_sumarray"></a>`_.sum(array)`
6442 <a href="#_sumarray">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L15527 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.sum "See the npm package")
6444 Computes the sum of the values in `array`.
6449 1. `array` *(Array)*: The array to iterate over.
6452 *(number)*: Returns the sum.
6456 _.sum([4, 2, 8, 6]);
6465 ### <a id="_sumbyarray-iteratee_identity"></a>`_.sumBy(array, [iteratee=_.identity])`
6466 <a href="#_sumbyarray-iteratee_identity">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L15557 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.sumby "See the npm package")
6468 This method is like `_.sum` except that it accepts `iteratee` which is
6469 invoked for each element in `array` to generate the value to be summed.
6470 The iteratee is invoked with one argument: *(value)*.
6475 1. `array` *(Array)*: The array to iterate over.
6476 2. `[iteratee=_.identity]` *(Array|Function|Object|string)*: The iteratee invoked per element.
6479 *(number)*: Returns the sum.
6483 var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
6485 _.sumBy(objects, function(o) { return o.n; });
6488 // The `_.property` iteratee shorthand.
6489 _.sumBy(objects, 'n');
6500 ## `“Number” Methods`
6504 ### <a id="_clampnumber-lower-upper"></a>`_.clamp(number, [lower], upper)`
6505 <a href="#_clampnumber-lower-upper">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L13139 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.clamp "See the npm package")
6507 Clamps `number` within the inclusive `lower` and `upper` bounds.
6512 1. `number` *(number)*: The number to clamp.
6513 2. `[lower]` *(number)*: The lower bound.
6514 3. `upper` *(number)*: The upper bound.
6517 *(number)*: Returns the clamped number.
6521 _.clamp(-10, -5, 5);
6533 ### <a id="_inrangenumber-start0-end"></a>`_.inRange(number, [start=0], end)`
6534 <a href="#_inrangenumber-start0-end">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L13193 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.inrange "See the npm package")
6536 Checks if `n` is between `start` and up to, but not including, `end`. If
6537 `end` is not specified, it's set to `start` with `start` then set to `0`.
6538 If `start` is greater than `end` the params are swapped to support
6544 1. `number` *(number)*: The number to check.
6545 2. `[start=0]` *(number)*: The start of the range.
6546 3. `end` *(number)*: The end of the range.
6549 *(boolean)*: Returns `true` if `number` is in the range, else `false`.
6571 _.inRange(-3, -2, -6);
6580 ### <a id="_randomlower0-upper1-floating"></a>`_.random([lower=0], [upper=1], [floating])`
6581 <a href="#_randomlower0-upper1-floating">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L13236 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.random "See the npm package")
6583 Produces a random number between the inclusive `lower` and `upper` bounds.
6584 If only one argument is provided a number between `0` and the given number
6585 is returned. If `floating` is `true`, or either `lower` or `upper` are
6586 floats, a floating-point number is returned instead of an integer.
6589 **Note:** JavaScript follows the IEEE-754 standard for resolving
6590 floating-point values which can produce unexpected results.
6595 1. `[lower=0]` *(number)*: The lower bound.
6596 2. `[upper=1]` *(number)*: The upper bound.
6597 3. `[floating]` *(boolean)*: Specify returning a floating-point number.
6600 *(number)*: Returns the random number.
6605 // => an integer between 0 and 5
6608 // => also an integer between 0 and 5
6611 // => a floating-point number between 0 and 5
6614 // => a floating-point number between 1.2 and 5.2
6624 ## `“Object” Methods`
6628 ### <a id="_assignobject-sources"></a>`_.assign(object, [sources])`
6629 <a href="#_assignobject-sources">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11752 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.assign "See the npm package")
6631 Assigns own enumerable string keyed properties of source objects to the
6632 destination object. Source objects are applied from left to right.
6633 Subsequent sources overwrite property assignments of previous sources.
6636 **Note:** This method mutates `object` and is loosely based on
6637 [`Object.assign`](https://mdn.io/Object/assign).
6642 1. `object` *(Object)*: The destination object.
6643 2. `[sources]` *(...Object)*: The source objects.
6646 *(Object)*: Returns `object`.
6658 Foo.prototype.d = 4;
6659 Bar.prototype.f = 6;
6661 _.assign({ 'a': 1 }, new Foo, new Bar);
6662 // => { 'a': 1, 'c': 3, 'e': 5 }
6670 ### <a id="_assigninobject-sources"></a>`_.assignIn(object, [sources])`
6671 <a href="#_assigninobject-sources">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11795 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.assignin "See the npm package")
6673 This method is like `_.assign` except that it iterates over own and
6674 inherited source properties.
6677 **Note:** This method mutates `object`.
6685 1. `object` *(Object)*: The destination object.
6686 2. `[sources]` *(...Object)*: The source objects.
6689 *(Object)*: Returns `object`.
6701 Foo.prototype.c = 3;
6702 Bar.prototype.e = 5;
6704 _.assignIn({ 'a': 1 }, new Foo, new Bar);
6705 // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5 }
6713 ### <a id="_assigninwithobject-sources-customizer"></a>`_.assignInWith(object, sources, [customizer])`
6714 <a href="#_assigninwithobject-sources-customizer">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11834 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.assigninwith "See the npm package")
6716 This method is like `_.assignIn` except that it accepts `customizer`
6717 which is invoked to produce the assigned values. If `customizer` returns
6718 `undefined`, assignment is handled by the method instead. The `customizer`
6719 is invoked with five arguments: *(objValue, srcValue, key, object, source)*.
6722 **Note:** This method mutates `object`.
6730 1. `object` *(Object)*: The destination object.
6731 2. `sources` *(...Object)*: The source objects.
6732 3. `[customizer]` *(Function)*: The function to customize assigned values.
6735 *(Object)*: Returns `object`.
6739 function customizer(objValue, srcValue) {
6740 return _.isUndefined(objValue) ? srcValue : objValue;
6743 var defaults = _.partialRight(_.assignInWith, customizer);
6745 defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
6746 // => { 'a': 1, 'b': 2 }
6754 ### <a id="_assignwithobject-sources-customizer"></a>`_.assignWith(object, sources, [customizer])`
6755 <a href="#_assignwithobject-sources-customizer">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11866 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.assignwith "See the npm package")
6757 This method is like `_.assign` except that it accepts `customizer`
6758 which is invoked to produce the assigned values. If `customizer` returns
6759 `undefined`, assignment is handled by the method instead. The `customizer`
6760 is invoked with five arguments: *(objValue, srcValue, key, object, source)*.
6763 **Note:** This method mutates `object`.
6768 1. `object` *(Object)*: The destination object.
6769 2. `sources` *(...Object)*: The source objects.
6770 3. `[customizer]` *(Function)*: The function to customize assigned values.
6773 *(Object)*: Returns `object`.
6777 function customizer(objValue, srcValue) {
6778 return _.isUndefined(objValue) ? srcValue : objValue;
6781 var defaults = _.partialRight(_.assignWith, customizer);
6783 defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
6784 // => { 'a': 1, 'b': 2 }
6792 ### <a id="_atobject-paths"></a>`_.at(object, [paths])`
6793 <a href="#_atobject-paths">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11890 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.at "See the npm package")
6795 Creates an array of values corresponding to `paths` of `object`.
6800 1. `object` *(Object)*: The object to iterate over.
6801 2. `[paths]` *(...(string|string[]))*: The property paths of elements to pick.
6804 *(Array)*: Returns the new array of picked elements.
6808 var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
6810 _.at(object, ['a[0].b.c', 'a[1]']);
6813 _.at(['a', 'b', 'c'], 0, 2);
6822 ### <a id="_createprototype-properties"></a>`_.create(prototype, [properties])`
6823 <a href="#_createprototype-properties">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11928 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.create "See the npm package")
6825 Creates an object that inherits from the `prototype` object. If a
6826 `properties` object is given, its own enumerable string keyed properties
6827 are assigned to the created object.
6832 1. `prototype` *(Object)*: The object to inherit from.
6833 2. `[properties]` *(Object)*: The properties to assign to the object.
6836 *(Object)*: Returns the new object.
6849 Circle.prototype = _.create(Shape.prototype, {
6850 'constructor': Circle
6853 var circle = new Circle;
6854 circle instanceof Circle;
6857 circle instanceof Shape;
6866 ### <a id="_defaultsobject-sources"></a>`_.defaults(object, [sources])`
6867 <a href="#_defaultsobject-sources">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11954 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.defaults "See the npm package")
6869 Assigns own and inherited enumerable string keyed properties of source
6870 objects to the destination object for all destination properties that
6871 resolve to `undefined`. Source objects are applied from left to right.
6872 Once a property is set, additional values of the same property are ignored.
6875 **Note:** This method mutates `object`.
6880 1. `object` *(Object)*: The destination object.
6881 2. `[sources]` *(...Object)*: The source objects.
6884 *(Object)*: Returns `object`.
6888 _.defaults({ 'user': 'barney' }, { 'age': 36 }, { 'user': 'fred' });
6889 // => { 'user': 'barney', 'age': 36 }
6897 ### <a id="_defaultsdeepobject-sources"></a>`_.defaultsDeep(object, [sources])`
6898 <a href="#_defaultsdeepobject-sources">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11979 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.defaultsdeep "See the npm package")
6900 This method is like `_.defaults` except that it recursively assigns
6904 **Note:** This method mutates `object`.
6909 1. `object` *(Object)*: The destination object.
6910 2. `[sources]` *(...Object)*: The source objects.
6913 *(Object)*: Returns `object`.
6917 _.defaultsDeep({ 'user': { 'name': 'barney' } }, { 'user': { 'name': 'fred', 'age': 36 } });
6918 // => { 'user': { 'name': 'barney', 'age': 36 } }
6926 ### <a id="_findkeyobject-predicate_identity"></a>`_.findKey(object, [predicate=_.identity])`
6927 <a href="#_findkeyobject-predicate_identity">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L12020 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.findkey "See the npm package")
6929 This method is like `_.find` except that it returns the key of the first
6930 element `predicate` returns truthy for instead of the element itself.
6935 1. `object` *(Object)*: The object to search.
6936 2. `[predicate=_.identity]` *(Array|Function|Object|string)*: The function invoked per iteration.
6939 *(*)*: Returns the key of the matched element, else `undefined`.
6944 'barney': { 'age': 36, 'active': true },
6945 'fred': { 'age': 40, 'active': false },
6946 'pebbles': { 'age': 1, 'active': true }
6949 _.findKey(users, function(o) { return o.age < 40; });
6950 // => 'barney' (iteration order is not guaranteed)
6952 // The `_.matches` iteratee shorthand.
6953 _.findKey(users, { 'age': 1, 'active': true });
6956 // The `_.matchesProperty` iteratee shorthand.
6957 _.findKey(users, ['active', false]);
6960 // The `_.property` iteratee shorthand.
6961 _.findKey(users, 'active');
6970 ### <a id="_findlastkeyobject-predicate_identity"></a>`_.findLastKey(object, [predicate=_.identity])`
6971 <a href="#_findlastkeyobject-predicate_identity">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L12060 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.findlastkey "See the npm package")
6973 This method is like `_.findKey` except that it iterates over elements of
6974 a collection in the opposite order.
6979 1. `object` *(Object)*: The object to search.
6980 2. `[predicate=_.identity]` *(Array|Function|Object|string)*: The function invoked per iteration.
6983 *(*)*: Returns the key of the matched element, else `undefined`.
6988 'barney': { 'age': 36, 'active': true },
6989 'fred': { 'age': 40, 'active': false },
6990 'pebbles': { 'age': 1, 'active': true }
6993 _.findLastKey(users, function(o) { return o.age < 40; });
6994 // => returns 'pebbles' assuming `_.findKey` returns 'barney'
6996 // The `_.matches` iteratee shorthand.
6997 _.findLastKey(users, { 'age': 36, 'active': true });
7000 // The `_.matchesProperty` iteratee shorthand.
7001 _.findLastKey(users, ['active', false]);
7004 // The `_.property` iteratee shorthand.
7005 _.findLastKey(users, 'active');
7014 ### <a id="_forinobject-iteratee_identity"></a>`_.forIn(object, [iteratee=_.identity])`
7015 <a href="#_forinobject-iteratee_identity">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L12092 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.forin "See the npm package")
7017 Iterates over own and inherited enumerable string keyed properties of an
7018 object and invokes `iteratee` for each property. The iteratee is invoked
7019 with three arguments: *(value, key, object)*. Iteratee functions may exit
7020 iteration early by explicitly returning `false`.
7025 1. `object` *(Object)*: The object to iterate over.
7026 2. `[iteratee=_.identity]` *(Function)*: The function invoked per iteration.
7029 *(Object)*: Returns `object`.
7038 Foo.prototype.c = 3;
7040 _.forIn(new Foo, function(value, key) {
7043 // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed).
7051 ### <a id="_forinrightobject-iteratee_identity"></a>`_.forInRight(object, [iteratee=_.identity])`
7052 <a href="#_forinrightobject-iteratee_identity">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L12124 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.forinright "See the npm package")
7054 This method is like `_.forIn` except that it iterates over properties of
7055 `object` in the opposite order.
7060 1. `object` *(Object)*: The object to iterate over.
7061 2. `[iteratee=_.identity]` *(Function)*: The function invoked per iteration.
7064 *(Object)*: Returns `object`.
7073 Foo.prototype.c = 3;
7075 _.forInRight(new Foo, function(value, key) {
7078 // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'.
7086 ### <a id="_forownobject-iteratee_identity"></a>`_.forOwn(object, [iteratee=_.identity])`
7087 <a href="#_forownobject-iteratee_identity">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L12158 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.forown "See the npm package")
7089 Iterates over own enumerable string keyed properties of an object and
7090 invokes `iteratee` for each property. The iteratee is invoked with three
7091 arguments: *(value, key, object)*. Iteratee functions may exit iteration
7092 early by explicitly returning `false`.
7097 1. `object` *(Object)*: The object to iterate over.
7098 2. `[iteratee=_.identity]` *(Function)*: The function invoked per iteration.
7101 *(Object)*: Returns `object`.
7110 Foo.prototype.c = 3;
7112 _.forOwn(new Foo, function(value, key) {
7115 // => Logs 'a' then 'b' (iteration order is not guaranteed).
7123 ### <a id="_forownrightobject-iteratee_identity"></a>`_.forOwnRight(object, [iteratee=_.identity])`
7124 <a href="#_forownrightobject-iteratee_identity">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L12188 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.forownright "See the npm package")
7126 This method is like `_.forOwn` except that it iterates over properties of
7127 `object` in the opposite order.
7132 1. `object` *(Object)*: The object to iterate over.
7133 2. `[iteratee=_.identity]` *(Function)*: The function invoked per iteration.
7136 *(Object)*: Returns `object`.
7145 Foo.prototype.c = 3;
7147 _.forOwnRight(new Foo, function(value, key) {
7150 // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'.
7158 ### <a id="_functionsobject"></a>`_.functions(object)`
7159 <a href="#_functionsobject">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L12215 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.functions "See the npm package")
7161 Creates an array of function property names from own enumerable properties
7167 1. `object` *(Object)*: The object to inspect.
7170 *(Array)*: Returns the new array of property names.
7175 this.a = _.constant('a');
7176 this.b = _.constant('b');
7179 Foo.prototype.c = _.constant('c');
7181 _.functions(new Foo);
7190 ### <a id="_functionsinobject"></a>`_.functionsIn(object)`
7191 <a href="#_functionsinobject">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L12242 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.functionsin "See the npm package")
7193 Creates an array of function property names from own and inherited
7194 enumerable properties of `object`.
7199 1. `object` *(Object)*: The object to inspect.
7202 *(Array)*: Returns the new array of property names.
7207 this.a = _.constant('a');
7208 this.b = _.constant('b');
7211 Foo.prototype.c = _.constant('c');
7213 _.functionsIn(new Foo);
7214 // => ['a', 'b', 'c']
7222 ### <a id="_getobject-path-defaultvalue"></a>`_.get(object, path, [defaultValue])`
7223 <a href="#_getobject-path-defaultvalue">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L12271 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.get "See the npm package")
7225 Gets the value at `path` of `object`. If the resolved value is
7226 `undefined`, the `defaultValue` is used in its place.
7231 1. `object` *(Object)*: The object to query.
7232 2. `path` *(Array|string)*: The path of the property to get.
7233 3. `[defaultValue]` *(*)*: The value returned for `undefined` resolved values.
7236 *(*)*: Returns the resolved value.
7240 var object = { 'a': [{ 'b': { 'c': 3 } }] };
7242 _.get(object, 'a[0].b.c');
7245 _.get(object, ['a', '0', 'b', 'c']);
7248 _.get(object, 'a.b.c', 'default');
7257 ### <a id="_hasobject-path"></a>`_.has(object, path)`
7258 <a href="#_hasobject-path">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L12303 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.has "See the npm package")
7260 Checks if `path` is a direct property of `object`.
7265 1. `object` *(Object)*: The object to query.
7266 2. `path` *(Array|string)*: The path to check.
7269 *(boolean)*: Returns `true` if `path` exists, else `false`.
7273 var object = { 'a': { 'b': 2 } };
7274 var other = _.create({ 'a': _.create({ 'b': 2 }) });
7279 _.has(object, 'a.b');
7282 _.has(object, ['a', 'b']);
7294 ### <a id="_hasinobject-path"></a>`_.hasIn(object, path)`
7295 <a href="#_hasinobject-path">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L12333 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.hasin "See the npm package")
7297 Checks if `path` is a direct or inherited property of `object`.
7302 1. `object` *(Object)*: The object to query.
7303 2. `path` *(Array|string)*: The path to check.
7306 *(boolean)*: Returns `true` if `path` exists, else `false`.
7310 var object = _.create({ 'a': _.create({ 'b': 2 }) });
7312 _.hasIn(object, 'a');
7315 _.hasIn(object, 'a.b');
7318 _.hasIn(object, ['a', 'b']);
7321 _.hasIn(object, 'b');
7330 ### <a id="_invertobject"></a>`_.invert(object)`
7331 <a href="#_invertobject">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L12355 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.invert "See the npm package")
7333 Creates an object composed of the inverted keys and values of `object`.
7334 If `object` contains duplicate values, subsequent values overwrite
7335 property assignments of previous values.
7340 1. `object` *(Object)*: The object to invert.
7343 *(Object)*: Returns the new inverted object.
7347 var object = { 'a': 1, 'b': 2, 'c': 1 };
7350 // => { '1': 'c', '2': 'b' }
7358 ### <a id="_invertbyobject-iteratee_identity"></a>`_.invertBy(object, [iteratee=_.identity])`
7359 <a href="#_invertbyobject-iteratee_identity">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L12386 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.invertby "See the npm package")
7361 This method is like `_.invert` except that the inverted object is generated
7362 from the results of running each element of `object` thru `iteratee`. The
7363 corresponding inverted value of each inverted key is an array of keys
7364 responsible for generating the inverted value. The iteratee is invoked
7365 with one argument: *(value)*.
7370 1. `object` *(Object)*: The object to invert.
7371 2. `[iteratee=_.identity]` *(Array|Function|Object|string)*: The iteratee invoked per element.
7374 *(Object)*: Returns the new inverted object.
7378 var object = { 'a': 1, 'b': 2, 'c': 1 };
7381 // => { '1': ['a', 'c'], '2': ['b'] }
7383 _.invertBy(object, function(value) {
7384 return 'group' + value;
7386 // => { 'group1': ['a', 'c'], 'group2': ['b'] }
7394 ### <a id="_invokeobject-path-args"></a>`_.invoke(object, path, [args])`
7395 <a href="#_invokeobject-path-args">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L12412 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.invoke "See the npm package")
7397 Invokes the method at `path` of `object`.
7402 1. `object` *(Object)*: The object to query.
7403 2. `path` *(Array|string)*: The path of the method to invoke.
7404 3. `[args]` *(...*)*: The arguments to invoke the method with.
7407 *(*)*: Returns the result of the invoked method.
7411 var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] };
7413 _.invoke(object, 'a[0].b.c.slice', 1, 3);
7422 ### <a id="_keysobject"></a>`_.keys(object)`
7423 <a href="#_keysobject">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L12442 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.keys "See the npm package")
7425 Creates an array of the own enumerable property names of `object`.
7428 **Note:** Non-object values are coerced to objects. See the
7429 [ES spec](http://ecma-international.org/ecma-262/6.0/#sec-object.keys)
7435 1. `object` *(Object)*: The object to query.
7438 *(Array)*: Returns the array of property names.
7447 Foo.prototype.c = 3;
7450 // => ['a', 'b'] (iteration order is not guaranteed)
7461 ### <a id="_keysinobject"></a>`_.keysIn(object)`
7462 <a href="#_keysinobject">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L12485 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.keysin "See the npm package")
7464 Creates an array of the own and inherited enumerable property names of `object`.
7467 **Note:** Non-object values are coerced to objects.
7472 1. `object` *(Object)*: The object to query.
7475 *(Array)*: Returns the array of property names.
7484 Foo.prototype.c = 3;
7487 // => ['a', 'b', 'c'] (iteration order is not guaranteed)
7495 ### <a id="_mapkeysobject-iteratee_identity"></a>`_.mapKeys(object, [iteratee=_.identity])`
7496 <a href="#_mapkeysobject-iteratee_identity">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L12527 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.mapkeys "See the npm package")
7498 The opposite of `_.mapValues`; this method creates an object with the
7499 same values as `object` and keys generated by running each own enumerable
7500 string keyed property of `object` thru `iteratee`. The iteratee is invoked
7501 with three arguments: *(value, key, object)*.
7506 1. `object` *(Object)*: The object to iterate over.
7507 2. `[iteratee=_.identity]` *(Array|Function|Object|string)*: The function invoked per iteration.
7510 *(Object)*: Returns the new mapped object.
7514 _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {
7517 // => { 'a1': 1, 'b2': 2 }
7525 ### <a id="_mapvaluesobject-iteratee_identity"></a>`_.mapValues(object, [iteratee=_.identity])`
7526 <a href="#_mapvaluesobject-iteratee_identity">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L12566 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.mapvalues "See the npm package")
7528 Creates an object with the same keys as `object` and values generated
7529 by running each own enumerable string keyed property of `object` thru
7530 `iteratee`. The iteratee is invoked with three arguments:<br>
7531 *(value, key, object)*.
7536 1. `object` *(Object)*: The object to iterate over.
7537 2. `[iteratee=_.identity]` *(Array|Function|Object|string)*: The function invoked per iteration.
7540 *(Object)*: Returns the new mapped object.
7545 'fred': { 'user': 'fred', 'age': 40 },
7546 'pebbles': { 'user': 'pebbles', 'age': 1 }
7549 _.mapValues(users, function(o) { return o.age; });
7550 // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
7552 // The `_.property` iteratee shorthand.
7553 _.mapValues(users, 'age');
7554 // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
7562 ### <a id="_mergeobject-sources"></a>`_.merge(object, [sources])`
7563 <a href="#_mergeobject-sources">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L12607 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.merge "See the npm package")
7565 This method is like `_.assign` except that it recursively merges own and
7566 inherited enumerable string keyed properties of source objects into the
7567 destination object. Source properties that resolve to `undefined` are
7568 skipped if a destination value exists. Array and plain object properties
7569 are merged recursively.Other objects and value types are overridden by
7570 assignment. Source objects are applied from left to right. Subsequent
7571 sources overwrite property assignments of previous sources.
7574 **Note:** This method mutates `object`.
7579 1. `object` *(Object)*: The destination object.
7580 2. `[sources]` *(...Object)*: The source objects.
7583 *(Object)*: Returns `object`.
7588 'data': [{ 'user': 'barney' }, { 'user': 'fred' }]
7592 'data': [{ 'age': 36 }, { 'age': 40 }]
7595 _.merge(users, ages);
7596 // => { 'data': [{ 'user': 'barney', 'age': 36 }, { 'user': 'fred', 'age': 40 }] }
7604 ### <a id="_mergewithobject-sources-customizer"></a>`_.mergeWith(object, sources, customizer)`
7605 <a href="#_mergewithobject-sources-customizer">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L12649 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.mergewith "See the npm package")
7607 This method is like `_.merge` except that it accepts `customizer` which
7608 is invoked to produce the merged values of the destination and source
7609 properties. If `customizer` returns `undefined`, merging is handled by the
7610 method instead. The `customizer` is invoked with seven arguments:<br>
7611 *(objValue, srcValue, key, object, source, stack)*.
7614 **Note:** This method mutates `object`.
7619 1. `object` *(Object)*: The destination object.
7620 2. `sources` *(...Object)*: The source objects.
7621 3. `customizer` *(Function)*: The function to customize assigned values.
7624 *(Object)*: Returns `object`.
7628 function customizer(objValue, srcValue) {
7629 if (_.isArray(objValue)) {
7630 return objValue.concat(srcValue);
7635 'fruits': ['apple'],
7636 'vegetables': ['beet']
7640 'fruits': ['banana'],
7641 'vegetables': ['carrot']
7644 _.mergeWith(object, other, customizer);
7645 // => { 'fruits': ['apple', 'banana'], 'vegetables': ['beet', 'carrot'] }
7653 ### <a id="_omitobject-props"></a>`_.omit(object, [props])`
7654 <a href="#_omitobject-props">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L12672 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.omit "See the npm package")
7656 The opposite of `_.pick`; this method creates an object composed of the
7657 own and inherited enumerable string keyed properties of `object` that are
7663 1. `object` *(Object)*: The source object.
7664 2. `[props]` *(...(string|string[]))*: The property identifiers to omit.
7667 *(Object)*: Returns the new object.
7671 var object = { 'a': 1, 'b': '2', 'c': 3 };
7673 _.omit(object, ['a', 'c']);
7682 ### <a id="_omitbyobject-predicate_identity"></a>`_.omitBy(object, [predicate=_.identity])`
7683 <a href="#_omitbyobject-predicate_identity">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L12701 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.omitby "See the npm package")
7685 The opposite of `_.pickBy`; this method creates an object composed of
7686 the own and inherited enumerable string keyed properties of `object` that
7687 `predicate` doesn't return truthy for. The predicate is invoked with two
7688 arguments: *(value, key)*.
7693 1. `object` *(Object)*: The source object.
7694 2. `[predicate=_.identity]` *(Array|Function|Object|string)*: The function invoked per property.
7697 *(Object)*: Returns the new object.
7701 var object = { 'a': 1, 'b': '2', 'c': 3 };
7703 _.omitBy(object, _.isNumber);
7712 ### <a id="_pickobject-props"></a>`_.pick(object, [props])`
7713 <a href="#_pickobject-props">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L12725 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.pick "See the npm package")
7715 Creates an object composed of the picked `object` properties.
7720 1. `object` *(Object)*: The source object.
7721 2. `[props]` *(...(string|string[]))*: The property identifiers to pick.
7724 *(Object)*: Returns the new object.
7728 var object = { 'a': 1, 'b': '2', 'c': 3 };
7730 _.pick(object, ['a', 'c']);
7731 // => { 'a': 1, 'c': 3 }
7739 ### <a id="_pickbyobject-predicate_identity"></a>`_.pickBy(object, [predicate=_.identity])`
7740 <a href="#_pickbyobject-predicate_identity">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L12748 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.pickby "See the npm package")
7742 Creates an object composed of the `object` properties `predicate` returns
7743 truthy for. The predicate is invoked with two arguments: *(value, key)*.
7748 1. `object` *(Object)*: The source object.
7749 2. `[predicate=_.identity]` *(Array|Function|Object|string)*: The function invoked per property.
7752 *(Object)*: Returns the new object.
7756 var object = { 'a': 1, 'b': '2', 'c': 3 };
7758 _.pickBy(object, _.isNumber);
7759 // => { 'a': 1, 'c': 3 }
7767 ### <a id="_resultobject-path-defaultvalue"></a>`_.result(object, path, [defaultValue])`
7768 <a href="#_resultobject-path-defaultvalue">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L12781 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.result "See the npm package")
7770 This method is like `_.get` except that if the resolved value is a
7771 function it's invoked with the `this` binding of its parent object and
7772 its result is returned.
7777 1. `object` *(Object)*: The object to query.
7778 2. `path` *(Array|string)*: The path of the property to resolve.
7779 3. `[defaultValue]` *(*)*: The value returned for `undefined` resolved values.
7782 *(*)*: Returns the resolved value.
7786 var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };
7788 _.result(object, 'a[0].b.c1');
7791 _.result(object, 'a[0].b.c2');
7794 _.result(object, 'a[0].b.c3', 'default');
7797 _.result(object, 'a[0].b.c3', _.constant('default'));
7806 ### <a id="_setobject-path-value"></a>`_.set(object, path, value)`
7807 <a href="#_setobject-path-value">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L12831 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.set "See the npm package")
7809 Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
7810 it's created. Arrays are created for missing index properties while objects
7811 are created for all other missing properties. Use `_.setWith` to customize
7815 **Note:** This method mutates `object`.
7820 1. `object` *(Object)*: The object to modify.
7821 2. `path` *(Array|string)*: The path of the property to set.
7822 3. `value` *(*)*: The value to set.
7825 *(Object)*: Returns `object`.
7829 var object = { 'a': [{ 'b': { 'c': 3 } }] };
7831 _.set(object, 'a[0].b.c', 4);
7832 console.log(object.a[0].b.c);
7835 _.set(object, ['x', '0', 'y', 'z'], 5);
7836 console.log(object.x[0].y.z);
7845 ### <a id="_setwithobject-path-value-customizer"></a>`_.setWith(object, path, value, [customizer])`
7846 <a href="#_setwithobject-path-value-customizer">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L12859 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.setwith "See the npm package")
7848 This method is like `_.set` except that it accepts `customizer` which is
7849 invoked to produce the objects of `path`. If `customizer` returns `undefined`
7850 path creation is handled by the method instead. The `customizer` is invoked
7851 with three arguments: *(nsValue, key, nsObject)*.
7854 **Note:** This method mutates `object`.
7859 1. `object` *(Object)*: The object to modify.
7860 2. `path` *(Array|string)*: The path of the property to set.
7861 3. `value` *(*)*: The value to set.
7862 4. `[customizer]` *(Function)*: The function to customize assigned values.
7865 *(Object)*: Returns `object`.
7871 _.setWith(object, '[0][1]', 'a', Object);
7872 // => { '0': { '1': 'a' } }
7880 ### <a id="_topairsobject"></a>`_.toPairs(object)`
7881 <a href="#_topairsobject">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L12887 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.topairs "See the npm package")
7883 Creates an array of own enumerable string keyed-value pairs for `object`
7884 which can be consumed by `_.fromPairs`.
7892 1. `object` *(Object)*: The object to query.
7895 *(Array)*: Returns the new array of key-value pairs.
7904 Foo.prototype.c = 3;
7907 // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)
7915 ### <a id="_topairsinobject"></a>`_.toPairsIn(object)`
7916 <a href="#_topairsinobject">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L12914 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.topairsin "See the npm package")
7918 Creates an array of own and inherited enumerable string keyed-value pairs
7919 for `object` which can be consumed by `_.fromPairs`.
7927 1. `object` *(Object)*: The object to query.
7930 *(Array)*: Returns the new array of key-value pairs.
7939 Foo.prototype.c = 3;
7941 _.toPairsIn(new Foo);
7942 // => [['a', 1], ['b', 2], ['c', 1]] (iteration order is not guaranteed)
7950 ### <a id="_transformobject-iteratee_identity-accumulator"></a>`_.transform(object, [iteratee=_.identity], [accumulator])`
7951 <a href="#_transformobject-iteratee_identity-accumulator">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L12947 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.transform "See the npm package")
7953 An alternative to `_.reduce`; this method transforms `object` to a new
7954 `accumulator` object which is the result of running each of its own
7955 enumerable string keyed properties thru `iteratee`, with each invocation
7956 potentially mutating the `accumulator` object. The iteratee is invoked
7957 with four arguments: *(accumulator, value, key, object)*. Iteratee functions
7958 may exit iteration early by explicitly returning `false`.
7963 1. `object` *(Array|Object)*: The object to iterate over.
7964 2. `[iteratee=_.identity]` *(Function)*: The function invoked per iteration.
7965 3. `[accumulator]` *(*)*: The custom accumulator value.
7968 *(*)*: Returns the accumulated value.
7972 _.transform([2, 3, 4], function(result, n) {
7973 result.push(n *= n);
7978 _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
7979 (result[value] || (result[value] = [])).push(key);
7981 // => { '1': ['a', 'c'], '2': ['b'] }
7989 ### <a id="_unsetobject-path"></a>`_.unset(object, path)`
7990 <a href="#_unsetobject-path">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L12996 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.unset "See the npm package")
7992 Removes the property at `path` of `object`.
7995 **Note:** This method mutates `object`.
8000 1. `object` *(Object)*: The object to modify.
8001 2. `path` *(Array|string)*: The path of the property to unset.
8004 *(boolean)*: Returns `true` if the property is deleted, else `false`.
8008 var object = { 'a': [{ 'b': { 'c': 7 } }] };
8009 _.unset(object, 'a[0].b.c');
8012 console.log(object);
8013 // => { 'a': [{ 'b': {} }] };
8015 _.unset(object, ['a', '0', 'b', 'c']);
8018 console.log(object);
8019 // => { 'a': [{ 'b': {} }] };
8027 ### <a id="_updateobject-path-updater"></a>`_.update(object, path, updater)`
8028 <a href="#_updateobject-path-updater">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L13027 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.update "See the npm package")
8030 This method is like `_.set` except that accepts `updater` to produce the
8031 value to set. Use `_.updateWith` to customize `path` creation. The `updater`
8032 is invoked with one argument: *(value)*.
8035 **Note:** This method mutates `object`.
8040 1. `object` *(Object)*: The object to modify.
8041 2. `path` *(Array|string)*: The path of the property to set.
8042 3. `updater` *(Function)*: The function to produce the updated value.
8045 *(Object)*: Returns `object`.
8049 var object = { 'a': [{ 'b': { 'c': 3 } }] };
8051 _.update(object, 'a[0].b.c', function(n) { return n * n; });
8052 console.log(object.a[0].b.c);
8055 _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; });
8056 console.log(object.x[0].y.z);
8065 ### <a id="_updatewithobject-path-updater-customizer"></a>`_.updateWith(object, path, updater, [customizer])`
8066 <a href="#_updatewithobject-path-updater-customizer">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L13055 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.updatewith "See the npm package")
8068 This method is like `_.update` except that it accepts `customizer` which is
8069 invoked to produce the objects of `path`. If `customizer` returns `undefined`
8070 path creation is handled by the method instead. The `customizer` is invoked
8071 with three arguments: *(nsValue, key, nsObject)*.
8074 **Note:** This method mutates `object`.
8079 1. `object` *(Object)*: The object to modify.
8080 2. `path` *(Array|string)*: The path of the property to set.
8081 3. `updater` *(Function)*: The function to produce the updated value.
8082 4. `[customizer]` *(Function)*: The function to customize assigned values.
8085 *(Object)*: Returns `object`.
8091 _.updateWith(object, '[0][1]', _.constant('a'), Object);
8092 // => { '0': { '1': 'a' } }
8100 ### <a id="_valuesobject"></a>`_.values(object)`
8101 <a href="#_valuesobject">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L13086 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.values "See the npm package")
8103 Creates an array of the own enumerable string keyed property values of `object`.
8106 **Note:** Non-object values are coerced to objects.
8111 1. `object` *(Object)*: The object to query.
8114 *(Array)*: Returns the array of property values.
8123 Foo.prototype.c = 3;
8126 // => [1, 2] (iteration order is not guaranteed)
8137 ### <a id="_valuesinobject"></a>`_.valuesIn(object)`
8138 <a href="#_valuesinobject">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L13114 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.valuesin "See the npm package")
8140 Creates an array of the own and inherited enumerable string keyed property
8144 **Note:** Non-object values are coerced to objects.
8149 1. `object` *(Object)*: The object to query.
8152 *(Array)*: Returns the array of property values.
8161 Foo.prototype.c = 3;
8163 _.valuesIn(new Foo);
8164 // => [1, 2, 3] (iteration order is not guaranteed)
8178 ### <a id="_value"></a>`_(value)`
8179 <a href="#_value">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L1457 "View in source") [Ⓣ][1]
8181 Creates a `lodash` object which wraps `value` to enable implicit method
8182 chain sequences. Methods that operate on and return arrays, collections,
8183 and functions can be chained together. Methods that retrieve a single value
8184 or may return a primitive value will automatically end the chain sequence
8185 and return the unwrapped value. Otherwise, the value must be unwrapped
8189 Explicit chain sequences, which must be unwrapped with `_#value`, may be
8190 enabled using `_.chain`.
8193 The execution of chained methods is lazy, that is, it's deferred until
8194 `_#value` is implicitly or explicitly called.
8197 Lazy evaluation allows several methods to support shortcut fusion.
8198 Shortcut fusion is an optimization to merge iteratee calls; this avoids
8199 the creation of intermediate arrays and can greatly reduce the number of
8200 iteratee executions. Sections of a chain sequence qualify for shortcut
8201 fusion if the section is applied to an array of at least `200` elements
8202 and any iteratees accept only one argument. The heuristic for whether a
8203 section qualifies for shortcut fusion is subject to change.
8206 Chaining is supported in custom builds as long as the `_#value` method is
8207 directly or indirectly included in the build.
8210 In addition to lodash methods, wrappers have `Array` and `String` methods.
8213 The wrapper `Array` methods are:<br>
8214 `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`
8217 The wrapper `String` methods are:<br>
8218 `replace` and `split`
8221 The wrapper methods that support shortcut fusion are:<br>
8222 `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,
8223 `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,
8224 `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`
8227 The chainable wrapper methods are:<br>
8228 `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,
8229 `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,
8230 `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,
8231 `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,
8232 `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,
8233 `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,
8234 `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`,
8235 `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`,
8236 `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`,
8237 `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`,
8238 `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,
8239 `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`,
8240 `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`,
8241 `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`,
8242 `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`,
8243 `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`,
8244 `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`,
8245 `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`,
8246 `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`,
8247 `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`,
8248 `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`,
8249 `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`,
8250 `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`,
8251 `zipObject`, `zipObjectDeep`, and `zipWith`
8254 The wrapper methods that are **not** chainable by default are:<br>
8255 `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,
8256 `cloneDeep`, `cloneDeepWith`, `cloneWith`, `deburr`, `divide`, `each`,
8257 `eachRight`, `endsWith`, `eq`, `escape`, `escapeRegExp`, `every`, `find`,
8258 `findIndex`, `findKey`, `findLast`, `findLastIndex`, `findLastKey`, `first`,
8259 `floor`, `forEach`, `forEachRight`, `forIn`, `forInRight`, `forOwn`,
8260 `forOwnRight`, `get`, `gt`, `gte`, `has`, `hasIn`, `head`, `identity`,
8261 `includes`, `indexOf`, `inRange`, `invoke`, `isArguments`, `isArray`,
8262 `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`, `isBoolean`, `isBuffer`,
8263 `isDate`, `isElement`, `isEmpty`, `isEqual`, `isEqualWith`, `isError`,
8264 `isFinite`, `isFunction`, `isInteger`, `isLength`, `isMap`, `isMatch`,
8265 `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`, `isNumber`,
8266 `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`, `isSafeInteger`,
8267 `isSet`, `isString`, `isUndefined`, `isTypedArray`, `isWeakMap`, `isWeakSet`,
8268 `join`, `kebabCase`, `last`, `lastIndexOf`, `lowerCase`, `lowerFirst`,
8269 `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`, `min`, `minBy`, `multiply`,
8270 `noConflict`, `noop`, `now`, `nth`, `pad`, `padEnd`, `padStart`, `parseInt`,
8271 `pop`, `random`, `reduce`, `reduceRight`, `repeat`, `result`, `round`,
8272 `runInContext`, `sample`, `shift`, `size`, `snakeCase`, `some`, `sortedIndex`,
8273 `sortedIndexBy`, `sortedLastIndex`, `sortedLastIndexBy`, `startCase`,
8274 `startsWith`, `subtract`, `sum`, `sumBy`, `template`, `times`, `toInteger`,
8275 `toJSON`, `toLength`, `toLower`, `toNumber`, `toSafeInteger`, `toString`,
8276 `toUpper`, `trim`, `trimEnd`, `trimStart`, `truncate`, `unescape`,
8277 `uniqueId`, `upperCase`, `upperFirst`, `value`, and `words`
8280 1. `value` *(*)*: The value to wrap in a `lodash` instance.
8283 *(Object)*: Returns the new `lodash` wrapper instance.
8287 function square(n) {
8291 var wrapped = _([1, 2, 3]);
8293 // Returns an unwrapped value.
8294 wrapped.reduce(_.add);
8297 // Returns a wrapped value.
8298 var squares = wrapped.map(square);
8303 _.isArray(squares.value());
8312 ### <a id="_chainvalue"></a>`_.chain(value)`
8313 <a href="#_chainvalue">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7876 "View in source") [Ⓣ][1]
8315 Creates a `lodash` wrapper instance that wraps `value` with explicit method
8316 chain sequences enabled. The result of such sequences must be unwrapped
8322 1. `value` *(*)*: The value to wrap.
8325 *(Object)*: Returns the new `lodash` wrapper instance.
8330 { 'user': 'barney', 'age': 36 },
8331 { 'user': 'fred', 'age': 40 },
8332 { 'user': 'pebbles', 'age': 1 }
8339 return o.user + ' is ' + o.age;
8343 // => 'pebbles is 1'
8351 ### <a id="_tapvalue-interceptor"></a>`_.tap(value, interceptor)`
8352 <a href="#_tapvalue-interceptor">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7905 "View in source") [Ⓣ][1]
8354 This method invokes `interceptor` and returns `value`. The interceptor
8355 is invoked with one argument; *(value)*. The purpose of this method is to
8356 "tap into" a method chain sequence in order to modify intermediate results.
8361 1. `value` *(*)*: The value to provide to `interceptor`.
8362 2. `interceptor` *(Function)*: The function to invoke.
8365 *(*)*: Returns `value`.
8370 .tap(function(array) {
8371 // Mutate input array.
8384 ### <a id="_thruvalue-interceptor"></a>`_.thru(value, interceptor)`
8385 <a href="#_thruvalue-interceptor">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7933 "View in source") [Ⓣ][1]
8387 This method is like `_.tap` except that it returns the result of `interceptor`.
8388 The purpose of this method is to "pass thru" values replacing intermediate
8389 results in a method chain sequence.
8394 1. `value` *(*)*: The value to provide to `interceptor`.
8395 2. `interceptor` *(Function)*: The function to invoke.
8398 *(*)*: Returns the result of `interceptor`.
8405 .thru(function(value) {
8417 ### <a id="_prototypesymboliterator"></a>`_.prototype[Symbol.iterator]()`
8418 <a href="#_prototypesymboliterator">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L8092 "View in source") [Ⓣ][1]
8420 Enables the wrapper to be iterable.
8425 *(Object)*: Returns the wrapper object.
8429 var wrapped = _([1, 2]);
8431 wrapped[Symbol.iterator]() === wrapped;
8434 Array.from(wrapped);
8443 ### <a id="_prototypeatpaths"></a>`_.prototype.at([paths])`
8444 <a href="#_prototypeatpaths">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7956 "View in source") [Ⓣ][1]
8446 This method is the wrapper version of `_.at`.
8451 1. `[paths]` *(...(string|string[]))*: The property paths of elements to pick.
8454 *(Object)*: Returns the new `lodash` wrapper instance.
8458 var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
8460 _(object).at(['a[0].b.c', 'a[1]']).value();
8463 _(['a', 'b', 'c']).at(0, 2).value();
8472 ### <a id="_prototypechain"></a>`_.prototype.chain()`
8473 <a href="#_prototypechain">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L8008 "View in source") [Ⓣ][1]
8475 Creates a `lodash` wrapper instance with explicit method chain sequences enabled.
8480 *(Object)*: Returns the new `lodash` wrapper instance.
8485 { 'user': 'barney', 'age': 36 },
8486 { 'user': 'fred', 'age': 40 }
8489 // A sequence without explicit chaining.
8491 // => { 'user': 'barney', 'age': 36 }
8493 // A sequence with explicit chaining.
8499 // => { 'user': 'barney' }
8507 ### <a id="_prototypecommit"></a>`_.prototype.commit()`
8508 <a href="#_prototypecommit">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L8038 "View in source") [Ⓣ][1]
8510 Executes the chain sequence and returns the wrapped result.
8515 *(Object)*: Returns the new `lodash` wrapper instance.
8520 var wrapped = _(array).push(3);
8525 wrapped = wrapped.commit();
8541 ### <a id="_prototypenext"></a>`_.prototype.next()`
8542 <a href="#_prototypenext">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L8064 "View in source") [Ⓣ][1]
8544 Gets the next value on a wrapped object following the
8545 [iterator protocol](https://mdn.io/iteration_protocols#iterator).
8550 *(Object)*: Returns the next iterator value.
8554 var wrapped = _([1, 2]);
8557 // => { 'done': false, 'value': 1 }
8560 // => { 'done': false, 'value': 2 }
8563 // => { 'done': true, 'value': undefined }
8571 ### <a id="_prototypeplantvalue"></a>`_.prototype.plant(value)`
8572 <a href="#_prototypeplantvalue">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L8120 "View in source") [Ⓣ][1]
8574 Creates a clone of the chain sequence planting `value` as the wrapped value.
8579 1. `value` *(*)*: The value to plant.
8582 *(Object)*: Returns the new `lodash` wrapper instance.
8586 function square(n) {
8590 var wrapped = _([1, 2]).map(square);
8591 var other = wrapped.plant([3, 4]);
8605 ### <a id="_prototypereverse"></a>`_.prototype.reverse()`
8606 <a href="#_prototypereverse">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L8160 "View in source") [Ⓣ][1]
8608 This method is the wrapper version of `_.reverse`.
8611 **Note:** This method mutates the wrapped array.
8616 *(Object)*: Returns the new `lodash` wrapper instance.
8620 var array = [1, 2, 3];
8622 _(array).reverse().value()
8634 ### <a id="_prototypevalue"></a>`_.prototype.value()`
8635 <a href="#_prototypevalue">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L8192 "View in source") [Ⓣ][1]
8637 Executes the chain sequence to resolve the unwrapped value.
8642 *_.prototype.toJSON, _.prototype.valueOf*
8645 *(*)*: Returns the resolved unwrapped value.
8649 _([1, 2, 3]).value();
8660 ## `“String” Methods`
8664 ### <a id="_camelcasestring"></a>`_.camelCase([string=''])`
8665 <a href="#_camelcasestring">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L13297 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.camelcase "See the npm package")
8667 Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).
8672 1. `[string='']` *(string)*: The string to convert.
8675 *(string)*: Returns the camel cased string.
8679 _.camelCase('Foo Bar');
8682 _.camelCase('--foo-bar--');
8685 _.camelCase('__FOO_BAR__');
8694 ### <a id="_capitalizestring"></a>`_.capitalize([string=''])`
8695 <a href="#_capitalizestring">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L13317 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.capitalize "See the npm package")
8697 Converts the first character of `string` to upper case and the remaining
8703 1. `[string='']` *(string)*: The string to capitalize.
8706 *(string)*: Returns the capitalized string.
8710 _.capitalize('FRED');
8719 ### <a id="_deburrstring"></a>`_.deburr([string=''])`
8720 <a href="#_deburrstring">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L13338 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.deburr "See the npm package")
8722 Deburrs `string` by converting
8723 [latin-1 supplementary letters](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)
8724 to basic latin letters and removing
8725 [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
8730 1. `[string='']` *(string)*: The string to deburr.
8733 *(string)*: Returns the deburred string.
8737 _.deburr('déjà vu');
8746 ### <a id="_endswithstring-target-positionstringlength"></a>`_.endsWith([string=''], [target], [position=string.length])`
8747 <a href="#_endswithstring-target-positionstringlength">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L13366 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.endswith "See the npm package")
8749 Checks if `string` ends with the given target string.
8754 1. `[string='']` *(string)*: The string to search.
8755 2. `[target]` *(string)*: The string to search for.
8756 3. `[position=string.length]` *(number)*: The position to search from.
8759 *(boolean)*: Returns `true` if `string` ends with `target`, else `false`.
8763 _.endsWith('abc', 'c');
8766 _.endsWith('abc', 'b');
8769 _.endsWith('abc', 'b', 2);
8778 ### <a id="_escapestring"></a>`_.escape([string=''])`
8779 <a href="#_escapestring">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L13413 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.escape "See the npm package")
8781 Converts the characters "&", "<", ">", '"', "'", and "\`" in `string` to
8782 their corresponding HTML entities.
8785 **Note:** No other characters are escaped. To escape additional
8786 characters use a third-party library like [_he_](https://mths.be/he).
8789 Though the ">" character is escaped for symmetry, characters like
8790 ">" and "/" don't need escaping in HTML and have no special meaning
8791 unless they're part of a tag or unquoted attribute value. See
8792 [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)
8793 *(under "semi-related fun fact")* for more details.
8796 Backticks are escaped because in IE < `9`, they can break out of
8797 attribute values or HTML comments. See [#59](https://html5sec.org/#59),
8798 [#102](https://html5sec.org/#102), [#108](https://html5sec.org/#108), and
8799 [#133](https://html5sec.org/#133) of the
8800 [HTML5 Security Cheatsheet](https://html5sec.org/) for more details.
8803 When working with HTML you should always
8804 [quote attribute values](http://wonko.com/post/html-escaping) to reduce
8810 1. `[string='']` *(string)*: The string to escape.
8813 *(string)*: Returns the escaped string.
8817 _.escape('fred, barney, & pebbles');
8818 // => 'fred, barney, & pebbles'
8826 ### <a id="_escaperegexpstring"></a>`_.escapeRegExp([string=''])`
8827 <a href="#_escaperegexpstring">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L13435 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.escaperegexp "See the npm package")
8829 Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+",
8830 "?", "(", ")", "[", "]", "{", "}", and "|" in `string`.
8835 1. `[string='']` *(string)*: The string to escape.
8838 *(string)*: Returns the escaped string.
8842 _.escapeRegExp('[lodash](https://lodash.com/)');
8843 // => '\[lodash\]\(https://lodash\.com/\)'
8851 ### <a id="_kebabcasestring"></a>`_.kebabCase([string=''])`
8852 <a href="#_kebabcasestring">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L13463 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.kebabcase "See the npm package")
8854 Converts `string` to
8855 [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).
8860 1. `[string='']` *(string)*: The string to convert.
8863 *(string)*: Returns the kebab cased string.
8867 _.kebabCase('Foo Bar');
8870 _.kebabCase('fooBar');
8873 _.kebabCase('__FOO_BAR__');
8882 ### <a id="_lowercasestring"></a>`_.lowerCase([string=''])`
8883 <a href="#_lowercasestring">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L13487 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.lowercase "See the npm package")
8885 Converts `string`, as space separated words, to lower case.
8890 1. `[string='']` *(string)*: The string to convert.
8893 *(string)*: Returns the lower cased string.
8897 _.lowerCase('--Foo-Bar--');
8900 _.lowerCase('fooBar');
8903 _.lowerCase('__FOO_BAR__');
8912 ### <a id="_lowerfirststring"></a>`_.lowerFirst([string=''])`
8913 <a href="#_lowerfirststring">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L13508 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.lowerfirst "See the npm package")
8915 Converts the first character of `string` to lower case.
8920 1. `[string='']` *(string)*: The string to convert.
8923 *(string)*: Returns the converted string.
8927 _.lowerFirst('Fred');
8930 _.lowerFirst('FRED');
8939 ### <a id="_padstring-length0-chars"></a>`_.pad([string=''], [length=0], [chars=' '])`
8940 <a href="#_padstring-length0-chars">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L13533 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.pad "See the npm package")
8942 Pads `string` on the left and right sides if it's shorter than `length`.
8943 Padding characters are truncated if they can't be evenly divided by `length`.
8948 1. `[string='']` *(string)*: The string to pad.
8949 2. `[length=0]` *(number)*: The padding length.
8950 3. `[chars=' ']` *(string)*: The string used as padding.
8953 *(string)*: Returns the padded string.
8960 _.pad('abc', 8, '_-');
8972 ### <a id="_padendstring-length0-chars"></a>`_.padEnd([string=''], [length=0], [chars=' '])`
8973 <a href="#_padendstring-length0-chars">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L13572 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.padend "See the npm package")
8975 Pads `string` on the right side if it's shorter than `length`. Padding
8976 characters are truncated if they exceed `length`.
8981 1. `[string='']` *(string)*: The string to pad.
8982 2. `[length=0]` *(number)*: The padding length.
8983 3. `[chars=' ']` *(string)*: The string used as padding.
8986 *(string)*: Returns the padded string.
8993 _.padEnd('abc', 6, '_-');
9005 ### <a id="_padstartstring-length0-chars"></a>`_.padStart([string=''], [length=0], [chars=' '])`
9006 <a href="#_padstartstring-length0-chars">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L13605 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.padstart "See the npm package")
9008 Pads `string` on the left side if it's shorter than `length`. Padding
9009 characters are truncated if they exceed `length`.
9014 1. `[string='']` *(string)*: The string to pad.
9015 2. `[length=0]` *(number)*: The padding length.
9016 3. `[chars=' ']` *(string)*: The string used as padding.
9019 *(string)*: Returns the padded string.
9023 _.padStart('abc', 6);
9026 _.padStart('abc', 6, '_-');
9029 _.padStart('abc', 3);
9038 ### <a id="_parseintstring-radix10"></a>`_.parseInt(string, [radix=10])`
9039 <a href="#_parseintstring-radix10">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L13639 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.parseint "See the npm package")
9041 Converts `string` to an integer of the specified radix. If `radix` is
9042 `undefined` or `0`, a `radix` of `10` is used unless `value` is a
9043 hexadecimal, in which case a `radix` of `16` is used.
9046 **Note:** This method aligns with the
9047 [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`.
9052 1. `string` *(string)*: The string to convert.
9053 2. `[radix=10]` *(number)*: The radix to interpret `value` by.
9056 *(number)*: Returns the converted integer.
9063 _.map(['6', '08', '10'], _.parseInt);
9072 ### <a id="_repeatstring-n1"></a>`_.repeat([string=''], [n=1])`
9073 <a href="#_repeatstring-n1">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L13673 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.repeat "See the npm package")
9075 Repeats the given string `n` times.
9080 1. `[string='']` *(string)*: The string to repeat.
9081 2. `[n=1]` *(number)*: The number of times to repeat the string.
9084 *(string)*: Returns the repeated string.
9103 ### <a id="_replacestring-pattern-replacement"></a>`_.replace([string=''], pattern, replacement)`
9104 <a href="#_replacestring-pattern-replacement">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L13701 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.replace "See the npm package")
9106 Replaces matches for `pattern` in `string` with `replacement`.
9109 **Note:** This method is based on
9110 [`String#replace`](https://mdn.io/String/replace).
9115 1. `[string='']` *(string)*: The string to modify.
9116 2. `pattern` *(RegExp|string)*: The pattern to replace.
9117 3. `replacement` *(Function|string)*: The match replacement.
9120 *(string)*: Returns the modified string.
9124 _.replace('Hi Fred', 'Fred', 'Barney');
9133 ### <a id="_snakecasestring"></a>`_.snakeCase([string=''])`
9134 <a href="#_snakecasestring">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L13729 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.snakecase "See the npm package")
9136 Converts `string` to
9137 [snake case](https://en.wikipedia.org/wiki/Snake_case).
9142 1. `[string='']` *(string)*: The string to convert.
9145 *(string)*: Returns the snake cased string.
9149 _.snakeCase('Foo Bar');
9152 _.snakeCase('fooBar');
9155 _.snakeCase('--FOO-BAR--');
9164 ### <a id="_splitstring-separator-limit"></a>`_.split([string=''], separator, [limit])`
9165 <a href="#_splitstring-separator-limit">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L13752 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.split "See the npm package")
9167 Splits `string` by `separator`.
9170 **Note:** This method is based on
9171 [`String#split`](https://mdn.io/String/split).
9176 1. `[string='']` *(string)*: The string to split.
9177 2. `separator` *(RegExp|string)*: The separator pattern to split by.
9178 3. `[limit]` *(number)*: The length to truncate results to.
9181 *(Array)*: Returns the new array of string segments.
9185 _.split('a-b-c', '-', 2);
9194 ### <a id="_startcasestring"></a>`_.startCase([string=''])`
9195 <a href="#_startcasestring">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L13794 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.startcase "See the npm package")
9197 Converts `string` to
9198 [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).
9203 1. `[string='']` *(string)*: The string to convert.
9206 *(string)*: Returns the start cased string.
9210 _.startCase('--foo-bar--');
9213 _.startCase('fooBar');
9216 _.startCase('__FOO_BAR__');
9225 ### <a id="_startswithstring-target-position0"></a>`_.startsWith([string=''], [target], [position=0])`
9226 <a href="#_startswithstring-target-position0">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L13821 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.startswith "See the npm package")
9228 Checks if `string` starts with the given target string.
9233 1. `[string='']` *(string)*: The string to search.
9234 2. `[target]` *(string)*: The string to search for.
9235 3. `[position=0]` *(number)*: The position to search from.
9238 *(boolean)*: Returns `true` if `string` starts with `target`, else `false`.
9242 _.startsWith('abc', 'a');
9245 _.startsWith('abc', 'b');
9248 _.startsWith('abc', 'b', 1);
9257 ### <a id="_templatestring-options-optionsescape_templatesettingsescape-optionsevaluate_templatesettingsevaluate-optionsimports_templatesettingsimports-optionsinterpolate_templatesettingsinterpolate-optionssourceurllodashtemplatesourcesn-optionsvariableobj"></a>`_.template([string=''], [options={}], [options.escape=_.templateSettings.escape], [options.evaluate=_.templateSettings.evaluate], [options.imports=_.templateSettings.imports], [options.interpolate=_.templateSettings.interpolate], [options.sourceURL='lodash.templateSources[n]'], [options.variable='obj'])`
9258 <a href="#_templatestring-options-optionsescape_templatesettingsescape-optionsevaluate_templatesettingsevaluate-optionsimports_templatesettingsimports-optionsinterpolate_templatesettingsinterpolate-optionssourceurllodashtemplatesourcesn-optionsvariableobj">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L13930 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.template "See the npm package")
9260 Creates a compiled template function that can interpolate data properties
9261 in "interpolate" delimiters, HTML-escape interpolated data properties in
9262 "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data
9263 properties may be accessed as free variables in the template. If a setting
9264 object is given, it takes precedence over `_.templateSettings` values.
9267 **Note:** In the development build `_.template` utilizes
9268 [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)
9269 for easier debugging.
9272 For more information on precompiling templates see
9273 [lodash's custom builds documentation](https://lodash.com/custom-builds).
9276 For more information on Chrome extension sandboxes see
9277 [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).
9282 1. `[string='']` *(string)*: The template string.
9283 2. `[options={}]` *(Object)*: The options object.
9284 3. `[options.escape=_.templateSettings.escape]` *(RegExp)*: The HTML "escape" delimiter.
9285 4. `[options.evaluate=_.templateSettings.evaluate]` *(RegExp)*: The "evaluate" delimiter.
9286 5. `[options.imports=_.templateSettings.imports]` *(Object)*: An object to import into the template as free variables.
9287 6. `[options.interpolate=_.templateSettings.interpolate]` *(RegExp)*: The "interpolate" delimiter.
9288 7. `[options.sourceURL='lodash.templateSources[n]']` *(string)*: The sourceURL of the compiled template.
9289 8. `[options.variable='obj']` *(string)*: The data object variable name.
9292 *(Function)*: Returns the compiled template function.
9296 // Use the "interpolate" delimiter to create a compiled template.
9297 var compiled = _.template('hello <%= user %>!');
9298 compiled({ 'user': 'fred' });
9301 // Use the HTML "escape" delimiter to escape data property values.
9302 var compiled = _.template('<b><%- value %></b>');
9303 compiled({ 'value': '<script>' });
9304 // => '<b><script></b>'
9306 // Use the "evaluate" delimiter to execute JavaScript and generate HTML.
9307 var compiled = _.template('<% _.forEach(users, function(user) { %><li><%- user %></li><% }); %>');
9308 compiled({ 'users': ['fred', 'barney'] });
9309 // => '<li>fred</li><li>barney</li>'
9311 // Use the internal `print` function in "evaluate" delimiters.
9312 var compiled = _.template('<% print("hello " + user); %>!');
9313 compiled({ 'user': 'barney' });
9314 // => 'hello barney!'
9316 // Use the ES delimiter as an alternative to the default "interpolate" delimiter.
9317 var compiled = _.template('hello ${ user }!');
9318 compiled({ 'user': 'pebbles' });
9319 // => 'hello pebbles!'
9321 // Use custom template delimiters.
9322 _.templateSettings.interpolate = /{{([\s\S]+?)}}/g;
9323 var compiled = _.template('hello {{ user }}!');
9324 compiled({ 'user': 'mustache' });
9325 // => 'hello mustache!'
9327 // Use backslashes to treat delimiters as plain text.
9328 var compiled = _.template('<%= "\\<%- value %\\>" %>');
9329 compiled({ 'value': 'ignored' });
9330 // => '<%- value %>'
9332 // Use the `imports` option to import `jQuery` as `jq`.
9333 var text = '<% jq.each(users, function(user) { %><li><%- user %></li><% }); %>';
9334 var compiled = _.template(text, { 'imports': { 'jq': jQuery } });
9335 compiled({ 'users': ['fred', 'barney'] });
9336 // => '<li>fred</li><li>barney</li>'
9338 // Use the `sourceURL` option to specify a custom sourceURL for the template.
9339 var compiled = _.template('hello <%= user %>!', { 'sourceURL': '/basic/greeting.jst' });
9341 // => Find the source of "greeting.jst" under the Sources tab or Resources panel of the web inspector.
9343 // Use the `variable` option to ensure a with-statement isn't used in the compiled template.
9344 var compiled = _.template('hi <%= data.user %>!', { 'variable': 'data' });
9346 // => function(data) {
9347 // var __t, __p = '';
9348 // __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!';
9352 // Use the `source` property to inline compiled templates for meaningful
9353 // line numbers in error messages and stack traces.
9354 fs.writeFileSync(path.join(cwd, 'jst.js'), '\
9356 "main": ' + _.template(mainText).source + '\
9366 ### <a id="_tolowerstring"></a>`_.toLower([string=''])`
9367 <a href="#_tolowerstring">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L14059 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.tolower "See the npm package")
9369 Converts `string`, as a whole, to lower case just like
9370 [String#toLowerCase](https://mdn.io/toLowerCase).
9375 1. `[string='']` *(string)*: The string to convert.
9378 *(string)*: Returns the lower cased string.
9382 _.toLower('--Foo-Bar--');
9385 _.toLower('fooBar');
9388 _.toLower('__FOO_BAR__');
9397 ### <a id="_toupperstring"></a>`_.toUpper([string=''])`
9398 <a href="#_toupperstring">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L14084 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.toupper "See the npm package")
9400 Converts `string`, as a whole, to upper case just like
9401 [String#toUpperCase](https://mdn.io/toUpperCase).
9406 1. `[string='']` *(string)*: The string to convert.
9409 *(string)*: Returns the upper cased string.
9413 _.toUpper('--foo-bar--');
9416 _.toUpper('fooBar');
9419 _.toUpper('__foo_bar__');
9428 ### <a id="_trimstring-charswhitespace"></a>`_.trim([string=''], [chars=whitespace])`
9429 <a href="#_trimstring-charswhitespace">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L14110 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.trim "See the npm package")
9431 Removes leading and trailing whitespace or specified characters from `string`.
9436 1. `[string='']` *(string)*: The string to trim.
9437 2. `[chars=whitespace]` *(string)*: The characters to trim.
9440 *(string)*: Returns the trimmed string.
9447 _.trim('-_-abc-_-', '_-');
9450 _.map([' foo ', ' bar '], _.trim);
9451 // => ['foo', 'bar']
9459 ### <a id="_trimendstring-charswhitespace"></a>`_.trimEnd([string=''], [chars=whitespace])`
9460 <a href="#_trimendstring-charswhitespace">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L14145 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.trimend "See the npm package")
9462 Removes trailing whitespace or specified characters from `string`.
9467 1. `[string='']` *(string)*: The string to trim.
9468 2. `[chars=whitespace]` *(string)*: The characters to trim.
9471 *(string)*: Returns the trimmed string.
9478 _.trimEnd('-_-abc-_-', '_-');
9487 ### <a id="_trimstartstring-charswhitespace"></a>`_.trimStart([string=''], [chars=whitespace])`
9488 <a href="#_trimstartstring-charswhitespace">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L14178 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.trimstart "See the npm package")
9490 Removes leading whitespace or specified characters from `string`.
9495 1. `[string='']` *(string)*: The string to trim.
9496 2. `[chars=whitespace]` *(string)*: The characters to trim.
9499 *(string)*: Returns the trimmed string.
9503 _.trimStart(' abc ');
9506 _.trimStart('-_-abc-_-', '_-');
9515 ### <a id="_truncatestring-options-optionslength30-optionsomission-optionsseparator"></a>`_.truncate([string=''], [options={}], [options.length=30], [options.omission='...'], [options.separator])`
9516 <a href="#_truncatestring-options-optionslength30-optionsomission-optionsseparator">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L14229 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.truncate "See the npm package")
9518 Truncates `string` if it's longer than the given maximum string length.
9519 The last characters of the truncated string are replaced with the omission
9520 string which defaults to "...".
9525 1. `[string='']` *(string)*: The string to truncate.
9526 2. `[options={}]` *(Object)*: The options object.
9527 3. `[options.length=30]` *(number)*: The maximum string length.
9528 4. `[options.omission='...']` *(string)*: The string to indicate text is omitted.
9529 5. `[options.separator]` *(RegExp|string)*: The separator pattern to truncate to.
9532 *(string)*: Returns the truncated string.
9536 _.truncate('hi-diddly-ho there, neighborino');
9537 // => 'hi-diddly-ho there, neighbo...'
9539 _.truncate('hi-diddly-ho there, neighborino', {
9543 // => 'hi-diddly-ho there,...'
9545 _.truncate('hi-diddly-ho there, neighborino', {
9549 // => 'hi-diddly-ho there...'
9551 _.truncate('hi-diddly-ho there, neighborino', {
9552 'omission': ' [...]'
9554 // => 'hi-diddly-ho there, neig [...]'
9562 ### <a id="_unescapestring"></a>`_.unescape([string=''])`
9563 <a href="#_unescapestring">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L14304 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.unescape "See the npm package")
9565 The inverse of `_.escape`; this method converts the HTML entities
9566 `&`, `<`, `>`, `"`, `'`, and ``` in `string` to
9567 their corresponding characters.
9570 **Note:** No other HTML entities are unescaped. To unescape additional
9571 HTML entities use a third-party library like [_he_](https://mths.be/he).
9576 1. `[string='']` *(string)*: The string to unescape.
9579 *(string)*: Returns the unescaped string.
9583 _.unescape('fred, barney, & pebbles');
9584 // => 'fred, barney, & pebbles'
9592 ### <a id="_uppercasestring"></a>`_.upperCase([string=''])`
9593 <a href="#_uppercasestring">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L14331 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.uppercase "See the npm package")
9595 Converts `string`, as space separated words, to upper case.
9600 1. `[string='']` *(string)*: The string to convert.
9603 *(string)*: Returns the upper cased string.
9607 _.upperCase('--foo-bar');
9610 _.upperCase('fooBar');
9613 _.upperCase('__foo_bar__');
9622 ### <a id="_upperfirststring"></a>`_.upperFirst([string=''])`
9623 <a href="#_upperfirststring">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L14352 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.upperfirst "See the npm package")
9625 Converts the first character of `string` to upper case.
9630 1. `[string='']` *(string)*: The string to convert.
9633 *(string)*: Returns the converted string.
9637 _.upperFirst('fred');
9640 _.upperFirst('FRED');
9649 ### <a id="_wordsstring-pattern"></a>`_.words([string=''], [pattern])`
9650 <a href="#_wordsstring-pattern">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L14373 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.words "See the npm package")
9652 Splits `string` into an array of its words.
9657 1. `[string='']` *(string)*: The string to inspect.
9658 2. `[pattern]` *(RegExp|string)*: The pattern to match words.
9661 *(Array)*: Returns the words of `string`.
9665 _.words('fred, barney, & pebbles');
9666 // => ['fred', 'barney', 'pebbles']
9668 _.words('fred, barney, & pebbles', /[^, ]+/g);
9669 // => ['fred', 'barney', '&', 'pebbles']
9683 ### <a id="_attemptfunc-args"></a>`_.attempt(func, [args])`
9684 <a href="#_attemptfunc-args">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L14407 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.attempt "See the npm package")
9686 Attempts to invoke `func`, returning either the result or the caught error
9687 object. Any additional arguments are provided to `func` when it's invoked.
9692 1. `func` *(Function)*: The function to attempt.
9693 2. `[args]` *(...*)*: The arguments to invoke `func` with.
9696 *(*)*: Returns the `func` result or error object.
9700 // Avoid throwing errors for invalid selectors.
9701 var elements = _.attempt(function(selector) {
9702 return document.querySelectorAll(selector);
9705 if (_.isError(elements)) {
9715 ### <a id="_bindallobject-methodnames"></a>`_.bindAll(object, methodNames)`
9716 <a href="#_bindallobject-methodnames">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L14441 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.bindall "See the npm package")
9718 Binds methods of an object to the object itself, overwriting the existing
9722 **Note:** This method doesn't set the "length" property of bound functions.
9727 1. `object` *(Object)*: The object to bind and assign the bound methods to.
9728 2. `methodNames` *(...(string|string[]))*: The object method names to bind.
9731 *(Object)*: Returns `object`.
9737 'onClick': function() {
9738 console.log('clicked ' + this.label);
9742 _.bindAll(view, 'onClick');
9743 jQuery(element).on('click', view.onClick);
9744 // => Logs 'clicked docs' when clicked.
9752 ### <a id="_condpairs"></a>`_.cond(pairs)`
9753 <a href="#_condpairs">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L14478 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.cond "See the npm package")
9755 Creates a function that iterates over `pairs` and invokes the corresponding
9756 function of the first predicate to return truthy. The predicate-function
9757 pairs are invoked with the `this` binding and arguments of the created
9763 1. `pairs` *(Array)*: The predicate-function pairs.
9766 *(Function)*: Returns the new function.
9771 [_.matches({ 'a': 1 }), _.constant('matches A')],
9772 [_.conforms({ 'b': _.isNumber }), _.constant('matches B')],
9773 [_.constant(true), _.constant('no match')]
9776 func({ 'a': 1, 'b': 2 });
9779 func({ 'a': 0, 'b': 1 });
9782 func({ 'a': '1', 'b': '2' });
9791 ### <a id="_conformssource"></a>`_.conforms(source)`
9792 <a href="#_conformssource">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L14521 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.conforms "See the npm package")
9794 Creates a function that invokes the predicate properties of `source` with
9795 the corresponding property values of a given object, returning `true` if
9796 all predicates return truthy, else `false`.
9801 1. `source` *(Object)*: The object of property predicates to conform to.
9804 *(Function)*: Returns the new function.
9809 { 'user': 'barney', 'age': 36 },
9810 { 'user': 'fred', 'age': 40 }
9813 _.filter(users, _.conforms({ 'age': _.partial(_.gt, _, 38) }));
9814 // => [{ 'user': 'fred', 'age': 40 }]
9822 ### <a id="_constantvalue"></a>`_.constant(value)`
9823 <a href="#_constantvalue">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L14542 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.constant "See the npm package")
9825 Creates a function that returns `value`.
9830 1. `value` *(*)*: The value to return from the new function.
9833 *(Function)*: Returns the new function.
9837 var object = { 'user': 'fred' };
9838 var getter = _.constant(object);
9840 getter() === object;
9849 ### <a id="_flowfuncs"></a>`_.flow([funcs])`
9850 <a href="#_flowfuncs">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L14570 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.flow "See the npm package")
9852 Creates a function that returns the result of invoking the given functions
9853 with the `this` binding of the created function, where each successive
9854 invocation is supplied the return value of the previous.
9859 1. `[funcs]` *(...(Function|Function[]))*: Functions to invoke.
9862 *(Function)*: Returns the new function.
9866 function square(n) {
9870 var addSquare = _.flow(_.add, square);
9880 ### <a id="_flowrightfuncs"></a>`_.flowRight([funcs])`
9881 <a href="#_flowrightfuncs">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L14593 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.flowright "See the npm package")
9883 This method is like `_.flow` except that it creates a function that
9884 invokes the given functions from right to left.
9889 1. `[funcs]` *(...(Function|Function[]))*: Functions to invoke.
9892 *(Function)*: Returns the new function.
9896 function square(n) {
9900 var addSquare = _.flowRight(square, _.add);
9910 ### <a id="_identityvalue"></a>`_.identity(value)`
9911 <a href="#_identityvalue">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L14611 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.identity "See the npm package")
9913 This method returns the first argument given to it.
9918 1. `value` *(*)*: Any value.
9921 *(*)*: Returns `value`.
9925 var object = { 'user': 'fred' };
9927 _.identity(object) === object;
9936 ### <a id="_iterateefunc_identity"></a>`_.iteratee([func=_.identity])`
9937 <a href="#_iterateefunc_identity">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L14657 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.iteratee "See the npm package")
9939 Creates a function that invokes `func` with the arguments of the created
9940 function. If `func` is a property name, the created function returns the
9941 property value for a given element. If `func` is an array or object, the
9942 created function returns `true` for elements that contain the equivalent
9943 source properties, otherwise it returns `false`.
9948 1. `[func=_.identity]` *(*)*: The value to convert to a callback.
9951 *(Function)*: Returns the callback.
9956 { 'user': 'barney', 'age': 36, 'active': true },
9957 { 'user': 'fred', 'age': 40, 'active': false }
9960 // The `_.matches` iteratee shorthand.
9961 _.filter(users, _.iteratee({ 'user': 'barney', 'active': true }));
9962 // => [{ 'user': 'barney', 'age': 36, 'active': true }]
9964 // The `_.matchesProperty` iteratee shorthand.
9965 _.filter(users, _.iteratee(['user', 'fred']));
9966 // => [{ 'user': 'fred', 'age': 40 }]
9968 // The `_.property` iteratee shorthand.
9969 _.map(users, _.iteratee('user'));
9970 // => ['barney', 'fred']
9972 // Create custom iteratee shorthands.
9973 _.iteratee = _.wrap(_.iteratee, function(iteratee, func) {
9974 return !_.isRegExp(func) ? iteratee(func) : function(string) {
9975 return func.test(string);
9979 _.filter(['abc', 'def'], /ef/);
9988 ### <a id="_matchessource"></a>`_.matches(source)`
9989 <a href="#_matchessource">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L14685 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.matches "See the npm package")
9991 Creates a function that performs a partial deep comparison between a given
9992 object and `source`, returning `true` if the given object has equivalent
9993 property values, else `false`. The created function is equivalent to
9994 `_.isMatch` with a `source` partially applied.
9997 **Note:** This method supports comparing the same values as `_.isEqual`.
10002 1. `source` *(Object)*: The object of property values to match.
10005 *(Function)*: Returns the new function.
10010 { 'user': 'barney', 'age': 36, 'active': true },
10011 { 'user': 'fred', 'age': 40, 'active': false }
10014 _.filter(users, _.matches({ 'age': 40, 'active': false }));
10015 // => [{ 'user': 'fred', 'age': 40, 'active': false }]
10023 ### <a id="_matchespropertypath-srcvalue"></a>`_.matchesProperty(path, srcValue)`
10024 <a href="#_matchespropertypath-srcvalue">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L14713 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.matchesproperty "See the npm package")
10026 Creates a function that performs a partial deep comparison between the
10027 value at `path` of a given object to `srcValue`, returning `true` if the
10028 object value is equivalent, else `false`.
10031 **Note:** This method supports comparing the same values as `_.isEqual`.
10036 1. `path` *(Array|string)*: The path of the property to get.
10037 2. `srcValue` *(*)*: The value to match.
10040 *(Function)*: Returns the new function.
10045 { 'user': 'barney' },
10049 _.find(users, _.matchesProperty('user', 'fred'));
10050 // => { 'user': 'fred' }
10058 ### <a id="_methodpath-args"></a>`_.method(path, [args])`
10059 <a href="#_methodpath-args">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L14741 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.method "See the npm package")
10061 Creates a function that invokes the method at `path` of a given object.
10062 Any additional arguments are provided to the invoked method.
10067 1. `path` *(Array|string)*: The path of the method to invoke.
10068 2. `[args]` *(...*)*: The arguments to invoke the method with.
10071 *(Function)*: Returns the new function.
10076 { 'a': { 'b': _.constant(2) } },
10077 { 'a': { 'b': _.constant(1) } }
10080 _.map(objects, _.method('a.b'));
10083 _.map(objects, _.method(['a', 'b']));
10092 ### <a id="_methodofobject-args"></a>`_.methodOf(object, [args])`
10093 <a href="#_methodofobject-args">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L14770 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.methodof "See the npm package")
10095 The opposite of `_.method`; this method creates a function that invokes
10096 the method at a given path of `object`. Any additional arguments are
10097 provided to the invoked method.
10102 1. `object` *(Object)*: The object to query.
10103 2. `[args]` *(...*)*: The arguments to invoke the method with.
10106 *(Function)*: Returns the new function.
10110 var array = _.times(3, _.constant),
10111 object = { 'a': array, 'b': array, 'c': array };
10113 _.map(['a[2]', 'c[0]'], _.methodOf(object));
10116 _.map([['a', '2'], ['c', '0']], _.methodOf(object));
10125 ### <a id="_mixinobjectlodash-source-options-optionschaintrue"></a>`_.mixin([object=lodash], source, [options={}], [options.chain=true])`
10126 <a href="#_mixinobjectlodash-source-options-optionschaintrue">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L14812 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.mixin "See the npm package")
10128 Adds all own enumerable string keyed function properties of a source
10129 object to the destination object. If `object` is a function, then methods
10130 are added to its prototype as well.
10133 **Note:** Use `_.runInContext` to create a pristine `lodash` function to
10134 avoid conflicts caused by modifying the original.
10139 1. `[object=lodash]` *(Function|Object)*: The destination object.
10140 2. `source` *(Object)*: The object of functions to add.
10141 3. `[options={}]` *(Object)*: The options object.
10142 4. `[options.chain=true]` *(boolean)*: Specify whether mixins are chainable.
10145 *(*)*: Returns `object`.
10149 function vowels(string) {
10150 return _.filter(string, function(v) {
10151 return /[aeiou]/i.test(v);
10155 _.mixin({ 'vowels': vowels });
10159 _('fred').vowels().value();
10162 _.mixin({ 'vowels': vowels }, { 'chain': false });
10163 _('fred').vowels();
10172 ### <a id="_noconflict"></a>`_.noConflict()`
10173 <a href="#_noconflict">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L14861 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.noconflict "See the npm package")
10175 Reverts the `_` variable to its previous value and returns a reference to
10176 the `lodash` function.
10181 *(Function)*: Returns the `lodash` function.
10185 var lodash = _.noConflict();
10193 ### <a id="_noop"></a>`_.noop()`
10194 <a href="#_noop">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L14883 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.noop "See the npm package")
10196 A no-operation function that returns `undefined` regardless of the
10197 arguments it receives.
10203 var object = { 'user': 'fred' };
10205 _.noop(object) === undefined;
10214 ### <a id="_nthargn0"></a>`_.nthArg([n=0])`
10215 <a href="#_nthargn0">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L14907 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.ntharg "See the npm package")
10217 Creates a function that returns its nth argument. If `n` is negative,
10218 the nth argument from the end is returned.
10223 1. `[n=0]` *(number)*: The index of the argument to return.
10226 *(Function)*: Returns the new function.
10230 var func = _.nthArg(1);
10231 func('a', 'b', 'c', 'd');
10234 var func = _.nthArg(-2);
10235 func('a', 'b', 'c', 'd');
10244 ### <a id="_overiteratees_identity"></a>`_.over([iteratees=[_.identity]])`
10245 <a href="#_overiteratees_identity">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L14932 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.over "See the npm package")
10247 Creates a function that invokes `iteratees` with the arguments it receives
10248 and returns their results.
10253 1. `[iteratees=[_.identity]]` *(...(Array|Array[]|Function|Function[]|Object|Object[]|string|string[]))*: The iteratees to invoke.
10256 *(Function)*: Returns the new function.
10260 var func = _.over(Math.max, Math.min);
10271 ### <a id="_overeverypredicates_identity"></a>`_.overEvery([predicates=[_.identity]])`
10272 <a href="#_overeverypredicates_identity">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L14958 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.overevery "See the npm package")
10274 Creates a function that checks if **all** of the `predicates` return
10275 truthy when invoked with the arguments it receives.
10280 1. `[predicates=[_.identity]]` *(...(Array|Array[]|Function|Function[]|Object|Object[]|string|string[]))*: The predicates to check.
10283 *(Function)*: Returns the new function.
10287 var func = _.overEvery(Boolean, isFinite);
10304 ### <a id="_oversomepredicates_identity"></a>`_.overSome([predicates=[_.identity]])`
10305 <a href="#_oversomepredicates_identity">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L14984 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.oversome "See the npm package")
10307 Creates a function that checks if **any** of the `predicates` return
10308 truthy when invoked with the arguments it receives.
10313 1. `[predicates=[_.identity]]` *(...(Array|Array[]|Function|Function[]|Object|Object[]|string|string[]))*: The predicates to check.
10316 *(Function)*: Returns the new function.
10320 var func = _.overSome(Boolean, isFinite);
10337 ### <a id="_propertypath"></a>`_.property(path)`
10338 <a href="#_propertypath">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L15008 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.property "See the npm package")
10340 Creates a function that returns the value at `path` of a given object.
10345 1. `path` *(Array|string)*: The path of the property to get.
10348 *(Function)*: Returns the new function.
10353 { 'a': { 'b': 2 } },
10354 { 'a': { 'b': 1 } }
10357 _.map(objects, _.property('a.b'));
10360 _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
10369 ### <a id="_propertyofobject"></a>`_.propertyOf(object)`
10370 <a href="#_propertyofobject">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L15033 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.propertyof "See the npm package")
10372 The opposite of `_.property`; this method creates a function that returns
10373 the value at a given path of `object`.
10378 1. `object` *(Object)*: The object to query.
10381 *(Function)*: Returns the new function.
10385 var array = [0, 1, 2],
10386 object = { 'a': array, 'b': array, 'c': array };
10388 _.map(['a[2]', 'c[0]'], _.propertyOf(object));
10391 _.map([['a', '2'], ['c', '0']], _.propertyOf(object));
10400 ### <a id="_rangestart0-end-step1"></a>`_.range([start=0], end, [step=1])`
10401 <a href="#_rangestart0-end-step1">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L15080 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.range "See the npm package")
10403 Creates an array of numbers *(positive and/or negative)* progressing from
10404 `start` up to, but not including, `end`. A step of `-1` is used if a negative
10405 `start` is specified without an `end` or `step`. If `end` is not specified,
10406 it's set to `start` with `start` then set to `0`.
10409 **Note:** JavaScript follows the IEEE-754 standard for resolving
10410 floating-point values which can produce unexpected results.
10415 1. `[start=0]` *(number)*: The start of the range.
10416 2. `end` *(number)*: The end of the range.
10417 3. `[step=1]` *(number)*: The value to increment or decrement by.
10420 *(Array)*: Returns the new array of numbers.
10428 // => [0, -1, -2, -3]
10434 // => [0, 5, 10, 15]
10436 _.range(0, -4, -1);
10437 // => [0, -1, -2, -3]
10451 ### <a id="_rangerightstart0-end-step1"></a>`_.rangeRight([start=0], end, [step=1])`
10452 <a href="#_rangerightstart0-end-step1">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L15118 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.rangeright "See the npm package")
10454 This method is like `_.range` except that it populates values in
10460 1. `[start=0]` *(number)*: The start of the range.
10461 2. `end` *(number)*: The end of the range.
10462 3. `[step=1]` *(number)*: The value to increment or decrement by.
10465 *(Array)*: Returns the new array of numbers.
10473 // => [-3, -2, -1, 0]
10475 _.rangeRight(1, 5);
10478 _.rangeRight(0, 20, 5);
10479 // => [15, 10, 5, 0]
10481 _.rangeRight(0, -4, -1);
10482 // => [-3, -2, -1, 0]
10484 _.rangeRight(1, 4, 0);
10496 ### <a id="_runincontextcontextroot"></a>`_.runInContext([context=root])`
10497 <a href="#_runincontextcontextroot">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L1239 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.runincontext "See the npm package")
10499 Create a new pristine `lodash` function using the `context` object.
10504 1. `[context=root]` *(Object)*: The context object.
10507 *(Function)*: Returns a new `lodash` function.
10511 _.mixin({ 'foo': _.constant('foo') });
10513 var lodash = _.runInContext();
10514 lodash.mixin({ 'bar': lodash.constant('bar') });
10516 _.isFunction(_.foo);
10518 _.isFunction(_.bar);
10521 lodash.isFunction(lodash.foo);
10523 lodash.isFunction(lodash.bar);
10526 // Use `context` to mock `Date#getTime` use in `_.now`.
10527 var mock = _.runInContext({
10528 'Date': function() {
10529 return { 'getTime': getTimeMock };
10533 // Create a suped-up `defer` in Node.js.
10534 var defer = _.runInContext({ 'setTimeout': setImmediate }).defer;
10542 ### <a id="_timesn-iteratee_identity"></a>`_.times(n, [iteratee=_.identity])`
10543 <a href="#_timesn-iteratee_identity">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L15139 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.times "See the npm package")
10545 Invokes the iteratee `n` times, returning an array of the results of
10546 each invocation. The iteratee is invoked with one argument; *(index)*.
10551 1. `n` *(number)*: The number of times to invoke `iteratee`.
10552 2. `[iteratee=_.identity]` *(Function)*: The function invoked per iteration.
10555 *(Array)*: Returns the array of results.
10559 _.times(3, String);
10560 // => ['0', '1', '2']
10562 _.times(4, _.constant(true));
10563 // => [true, true, true, true]
10571 ### <a id="_topathvalue"></a>`_.toPath(value)`
10572 <a href="#_topathvalue">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L15183 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.topath "See the npm package")
10574 Converts `value` to a property path array.
10579 1. `value` *(*)*: The value to convert.
10582 *(Array)*: Returns the new property path array.
10587 // => ['a', 'b', 'c']
10589 _.toPath('a[0].b.c');
10590 // => ['a', '0', 'b', 'c']
10592 var path = ['a', 'b', 'c'],
10593 newPath = _.toPath(path);
10595 console.log(newPath);
10596 // => ['a', 'b', 'c']
10598 console.log(path === newPath);
10607 ### <a id="_uniqueidprefix"></a>`_.uniqueId([prefix=''])`
10608 <a href="#_uniqueidprefix">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L15207 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.uniqueid "See the npm package")
10610 Generates a unique ID. If `prefix` is given, the ID is appended to it.
10615 1. `[prefix='']` *(string)*: The value to prefix the ID with.
10618 *(string)*: Returns the unique ID.
10622 _.uniqueId('contact_');
10623 // => 'contact_104'
10640 ### <a id="_version"></a>`_.VERSION`
10641 <a href="#_version">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L15894 "View in source") [Ⓣ][1]
10643 (string): The semantic version number.
10651 ### <a id="_templatesettings"></a>`_.templateSettings`
10652 <a href="#_templatesettings">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L1502 "View in source") [Ⓣ][1] [Ⓝ](https://www.npmjs.com/package/lodash.templatesettings "See the npm package")
10654 (Object): By default, the template delimiters used by lodash are like those in
10655 embedded Ruby *(ERB)*. Change the following template settings to use
10656 alternative delimiters.
10664 ### <a id="_templatesettingsescape"></a>`_.templateSettings.escape`
10665 <a href="#_templatesettingsescape">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L1510 "View in source") [Ⓣ][1]
10667 (RegExp): Used to detect `data` property values to be HTML-escaped.
10675 ### <a id="_templatesettingsevaluate"></a>`_.templateSettings.evaluate`
10676 <a href="#_templatesettingsevaluate">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L1518 "View in source") [Ⓣ][1]
10678 (RegExp): Used to detect code to be evaluated.
10686 ### <a id="_templatesettingsimports"></a>`_.templateSettings.imports`
10687 <a href="#_templatesettingsimports">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L1542 "View in source") [Ⓣ][1]
10689 (Object): Used to import variables into the compiled template.
10697 ### <a id="_templatesettingsinterpolate"></a>`_.templateSettings.interpolate`
10698 <a href="#_templatesettingsinterpolate">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L1526 "View in source") [Ⓣ][1]
10700 (RegExp): Used to detect `data` property values to inject.
10708 ### <a id="_templatesettingsvariable"></a>`_.templateSettings.variable`
10709 <a href="#_templatesettingsvariable">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L1534 "View in source") [Ⓣ][1]
10711 (string): Used to reference the data object in the template text.
10725 ### <a id="_templatesettingsimports_"></a>`_.templateSettings.imports._`
10726 <a href="#_templatesettingsimports_">#</a> [Ⓢ](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L1550 "View in source") [Ⓣ][1]
10728 A reference to the `lodash` function.
10738 [1]: #array "Jump back to the TOC."