Built motion from commit 7767ffc.|0.0.132
[motion.git] / public / bower_components / lodash / doc / README.md
1 # <a href="https://lodash.com/">lodash</a> <span>v4.11.2</span>
2
3 <!-- div class="toc-container" -->
4
5 <!-- div -->
6
7 ## `Array`
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>
73
74 <!-- /div -->
75
76 <!-- div -->
77
78 ## `Collection`
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>
107
108 <!-- /div -->
109
110 <!-- div -->
111
112 ## `Date`
113 * <a href="#_now">`_.now`</a>
114
115 <!-- /div -->
116
117 <!-- div -->
118
119 ## `Function`
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>
143
144 <!-- /div -->
145
146 <!-- div -->
147
148 ## `Lang`
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>
203
204 <!-- /div -->
205
206 <!-- div -->
207
208 ## `Math`
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>
224
225 <!-- /div -->
226
227 <!-- div -->
228
229 ## `Number`
230 * <a href="#_clampnumber-lower-upper">`_.clamp`</a>
231 * <a href="#_inrangenumber-start0-end">`_.inRange`</a>
232 * <a href="#_randomlower0-upper1-floating">`_.random`</a>
233
234 <!-- /div -->
235
236 <!-- div -->
237
238 ## `Object`
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>
286
287 <!-- /div -->
288
289 <!-- div -->
290
291 ## `Seq`
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>
306
307 <!-- /div -->
308
309 <!-- div -->
310
311 ## `String`
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>
342
343 <!-- /div -->
344
345 <!-- div -->
346
347 ## `Util`
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>
376
377 <!-- /div -->
378
379 <!-- div -->
380
381 ## `Properties`
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>
389
390 <!-- /div -->
391
392 <!-- div -->
393
394 ## `Methods`
395 * <a href="#_templatesettingsimports_">`_.templateSettings.imports._`</a>
396
397 <!-- /div -->
398
399 <!-- /div -->
400
401 <!-- div class="doc-container" -->
402
403 <!-- div -->
404
405 ## `“Array” Methods`
406
407 <!-- div -->
408
409 ### <a id="_chunkarray-size1"></a>`_.chunk(array, [size=1])`
410 <a href="#_chunkarray-size1">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L5982 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.chunk "See the npm package")
411
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
414 elements.
415
416 #### Since
417 3.0.0
418 #### Arguments
419 1. `array` *(Array)*: The array to process.
420 2. `[size=1]` *(number)*: The length of each chunk
421
422 #### Returns
423 *(Array)*: Returns the new array containing chunks.
424
425 #### Example
426 ```js
427 _.chunk(['a', 'b', 'c', 'd'], 2);
428 // => [['a', 'b'], ['c', 'd']]
429
430 _.chunk(['a', 'b', 'c', 'd'], 3);
431 // => [['a', 'b', 'c'], ['d']]
432 ```
433 * * *
434
435 <!-- /div -->
436
437 <!-- div -->
438
439 ### <a id="_compactarray"></a>`_.compact(array)`
440 <a href="#_compactarray">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6017 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.compact "See the npm package")
441
442 Creates an array with all falsey values removed. The values `false`, `null`,
443 `0`, `""`, `undefined`, and `NaN` are falsey.
444
445 #### Since
446 0.1.0
447 #### Arguments
448 1. `array` *(Array)*: The array to compact.
449
450 #### Returns
451 *(Array)*: Returns the new array of filtered values.
452
453 #### Example
454 ```js
455 _.compact([0, 1, false, 2, '', 3]);
456 // => [1, 2, 3]
457 ```
458 * * *
459
460 <!-- /div -->
461
462 <!-- div -->
463
464 ### <a id="_concatarray-values"></a>`_.concat(array, [values])`
465 <a href="#_concatarray-values">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6054 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.concat "See the npm package")
466
467 Creates a new array concatenating `array` with any additional arrays
468 and/or values.
469
470 #### Since
471 4.0.0
472 #### Arguments
473 1. `array` *(Array)*: The array to concatenate.
474 2. `[values]` *(...&#42;)*: The values to concatenate.
475
476 #### Returns
477 *(Array)*: Returns the new concatenated array.
478
479 #### Example
480 ```js
481 var array = [1];
482 var other = _.concat(array, 2, [3], [[4]]);
483
484 console.log(other);
485 // => [1, 2, 3, [4]]
486
487 console.log(array);
488 // => [1]
489 ```
490 * * *
491
492 <!-- /div -->
493
494 <!-- div -->
495
496 ### <a id="_differencearray-values"></a>`_.difference(array, [values])`
497 <a href="#_differencearray-values">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6087 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.difference "See the npm package")
498
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.
503
504 #### Since
505 0.1.0
506 #### Arguments
507 1. `array` *(Array)*: The array to inspect.
508 2. `[values]` *(...Array)*: The values to exclude.
509
510 #### Returns
511 *(Array)*: Returns the new array of filtered values.
512
513 #### Example
514 ```js
515 _.difference([3, 2, 1], [4, 2]);
516 // => [3, 1]
517 ```
518 * * *
519
520 <!-- /div -->
521
522 <!-- div -->
523
524 ### <a id="_differencebyarray-values-iteratee_identity"></a>`_.differenceBy(array, [values], [iteratee=_.identity])`
525 <a href="#_differencebyarray-values-iteratee_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6117 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.differenceby "See the npm package")
526
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)*.
531
532 #### Since
533 4.0.0
534 #### Arguments
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.
538
539 #### Returns
540 *(Array)*: Returns the new array of filtered values.
541
542 #### Example
543 ```js
544 _.differenceBy([3.1, 2.2, 1.3], [4.4, 2.5], Math.floor);
545 // => [3.1, 1.3]
546
547 // The `_.property` iteratee shorthand.
548 _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x');
549 // => [{ 'x': 2 }]
550 ```
551 * * *
552
553 <!-- /div -->
554
555 <!-- div -->
556
557 ### <a id="_differencewitharray-values-comparator"></a>`_.differenceWith(array, [values], [comparator])`
558 <a href="#_differencewitharray-values-comparator">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6148 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.differencewith "See the npm package")
559
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>
563 *(arrVal, othVal)*.
564
565 #### Since
566 4.0.0
567 #### Arguments
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.
571
572 #### Returns
573 *(Array)*: Returns the new array of filtered values.
574
575 #### Example
576 ```js
577 var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
578
579 _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual);
580 // => [{ 'x': 2, 'y': 1 }]
581 ```
582 * * *
583
584 <!-- /div -->
585
586 <!-- div -->
587
588 ### <a id="_droparray-n1"></a>`_.drop(array, [n=1])`
589 <a href="#_droparray-n1">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6183 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.drop "See the npm package")
590
591 Creates a slice of `array` with `n` elements dropped from the beginning.
592
593 #### Since
594 0.5.0
595 #### Arguments
596 1. `array` *(Array)*: The array to query.
597 2. `[n=1]` *(number)*: The number of elements to drop.
598
599 #### Returns
600 *(Array)*: Returns the slice of `array`.
601
602 #### Example
603 ```js
604 _.drop([1, 2, 3]);
605 // => [2, 3]
606
607 _.drop([1, 2, 3], 2);
608 // => [3]
609
610 _.drop([1, 2, 3], 5);
611 // => []
612
613 _.drop([1, 2, 3], 0);
614 // => [1, 2, 3]
615 ```
616 * * *
617
618 <!-- /div -->
619
620 <!-- div -->
621
622 ### <a id="_droprightarray-n1"></a>`_.dropRight(array, [n=1])`
623 <a href="#_droprightarray-n1">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6217 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.dropright "See the npm package")
624
625 Creates a slice of `array` with `n` elements dropped from the end.
626
627 #### Since
628 3.0.0
629 #### Arguments
630 1. `array` *(Array)*: The array to query.
631 2. `[n=1]` *(number)*: The number of elements to drop.
632
633 #### Returns
634 *(Array)*: Returns the slice of `array`.
635
636 #### Example
637 ```js
638 _.dropRight([1, 2, 3]);
639 // => [1, 2]
640
641 _.dropRight([1, 2, 3], 2);
642 // => [1]
643
644 _.dropRight([1, 2, 3], 5);
645 // => []
646
647 _.dropRight([1, 2, 3], 0);
648 // => [1, 2, 3]
649 ```
650 * * *
651
652 <!-- /div -->
653
654 <!-- div -->
655
656 ### <a id="_droprightwhilearray-predicate_identity"></a>`_.dropRightWhile(array, [predicate=_.identity])`
657 <a href="#_droprightwhilearray-predicate_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6263 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.droprightwhile "See the npm package")
658
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)*.
662
663 #### Since
664 3.0.0
665 #### Arguments
666 1. `array` *(Array)*: The array to query.
667 2. `[predicate=_.identity]` *(Array|Function|Object|string)*: The function invoked per iteration.
668
669 #### Returns
670 *(Array)*: Returns the slice of `array`.
671
672 #### Example
673 ```js
674 var users = [
675   { 'user': 'barney',  'active': true },
676   { 'user': 'fred',    'active': false },
677   { 'user': 'pebbles', 'active': false }
678 ];
679
680 _.dropRightWhile(users, function(o) { return !o.active; });
681 // => objects for ['barney']
682
683 // The `_.matches` iteratee shorthand.
684 _.dropRightWhile(users, { 'user': 'pebbles', 'active': false });
685 // => objects for ['barney', 'fred']
686
687 // The `_.matchesProperty` iteratee shorthand.
688 _.dropRightWhile(users, ['active', false]);
689 // => objects for ['barney']
690
691 // The `_.property` iteratee shorthand.
692 _.dropRightWhile(users, 'active');
693 // => objects for ['barney', 'fred', 'pebbles']
694 ```
695 * * *
696
697 <!-- /div -->
698
699 <!-- div -->
700
701 ### <a id="_dropwhilearray-predicate_identity"></a>`_.dropWhile(array, [predicate=_.identity])`
702 <a href="#_dropwhilearray-predicate_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6305 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.dropwhile "See the npm package")
703
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)*.
707
708 #### Since
709 3.0.0
710 #### Arguments
711 1. `array` *(Array)*: The array to query.
712 2. `[predicate=_.identity]` *(Array|Function|Object|string)*: The function invoked per iteration.
713
714 #### Returns
715 *(Array)*: Returns the slice of `array`.
716
717 #### Example
718 ```js
719 var users = [
720   { 'user': 'barney',  'active': false },
721   { 'user': 'fred',    'active': false },
722   { 'user': 'pebbles', 'active': true }
723 ];
724
725 _.dropWhile(users, function(o) { return !o.active; });
726 // => objects for ['pebbles']
727
728 // The `_.matches` iteratee shorthand.
729 _.dropWhile(users, { 'user': 'barney', 'active': false });
730 // => objects for ['fred', 'pebbles']
731
732 // The `_.matchesProperty` iteratee shorthand.
733 _.dropWhile(users, ['active', false]);
734 // => objects for ['pebbles']
735
736 // The `_.property` iteratee shorthand.
737 _.dropWhile(users, 'active');
738 // => objects for ['barney', 'fred', 'pebbles']
739 ```
740 * * *
741
742 <!-- /div -->
743
744 <!-- div -->
745
746 ### <a id="_fillarray-value-start0-endarraylength"></a>`_.fill(array, value, [start=0], [end=array.length])`
747 <a href="#_fillarray-value-start0-endarraylength">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6340 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.fill "See the npm package")
748
749 Fills elements of `array` with `value` from `start` up to, but not
750 including, `end`.
751 <br>
752 <br>
753 **Note:** This method mutates `array`.
754
755 #### Since
756 3.2.0
757 #### Arguments
758 1. `array` *(Array)*: The array to fill.
759 2. `value` *(&#42;)*: The value to fill `array` with.
760 3. `[start=0]` *(number)*: The start position.
761 4. `[end=array.length]` *(number)*: The end position.
762
763 #### Returns
764 *(Array)*: Returns `array`.
765
766 #### Example
767 ```js
768 var array = [1, 2, 3];
769
770 _.fill(array, 'a');
771 console.log(array);
772 // => ['a', 'a', 'a']
773
774 _.fill(Array(3), 2);
775 // => [2, 2, 2]
776
777 _.fill([4, 6, 8, 10], '*', 1, 3);
778 // => [4, '*', '*', 10]
779 ```
780 * * *
781
782 <!-- /div -->
783
784 <!-- div -->
785
786 ### <a id="_findindexarray-predicate_identity"></a>`_.findIndex(array, [predicate=_.identity])`
787 <a href="#_findindexarray-predicate_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6387 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.findindex "See the npm package")
788
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.
791
792 #### Since
793 1.1.0
794 #### Arguments
795 1. `array` *(Array)*: The array to search.
796 2. `[predicate=_.identity]` *(Array|Function|Object|string)*: The function invoked per iteration.
797
798 #### Returns
799 *(number)*: Returns the index of the found element, else `-1`.
800
801 #### Example
802 ```js
803 var users = [
804   { 'user': 'barney',  'active': false },
805   { 'user': 'fred',    'active': false },
806   { 'user': 'pebbles', 'active': true }
807 ];
808
809 _.findIndex(users, function(o) { return o.user == 'barney'; });
810 // => 0
811
812 // The `_.matches` iteratee shorthand.
813 _.findIndex(users, { 'user': 'fred', 'active': false });
814 // => 1
815
816 // The `_.matchesProperty` iteratee shorthand.
817 _.findIndex(users, ['active', false]);
818 // => 0
819
820 // The `_.property` iteratee shorthand.
821 _.findIndex(users, 'active');
822 // => 2
823 ```
824 * * *
825
826 <!-- /div -->
827
828 <!-- div -->
829
830 ### <a id="_findlastindexarray-predicate_identity"></a>`_.findLastIndex(array, [predicate=_.identity])`
831 <a href="#_findlastindexarray-predicate_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6428 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.findlastindex "See the npm package")
832
833 This method is like `_.findIndex` except that it iterates over elements
834 of `collection` from right to left.
835
836 #### Since
837 2.0.0
838 #### Arguments
839 1. `array` *(Array)*: The array to search.
840 2. `[predicate=_.identity]` *(Array|Function|Object|string)*: The function invoked per iteration.
841
842 #### Returns
843 *(number)*: Returns the index of the found element, else `-1`.
844
845 #### Example
846 ```js
847 var users = [
848   { 'user': 'barney',  'active': true },
849   { 'user': 'fred',    'active': false },
850   { 'user': 'pebbles', 'active': false }
851 ];
852
853 _.findLastIndex(users, function(o) { return o.user == 'pebbles'; });
854 // => 2
855
856 // The `_.matches` iteratee shorthand.
857 _.findLastIndex(users, { 'user': 'barney', 'active': true });
858 // => 0
859
860 // The `_.matchesProperty` iteratee shorthand.
861 _.findLastIndex(users, ['active', false]);
862 // => 2
863
864 // The `_.property` iteratee shorthand.
865 _.findLastIndex(users, 'active');
866 // => 0
867 ```
868 * * *
869
870 <!-- /div -->
871
872 <!-- div -->
873
874 ### <a id="_flattenarray"></a>`_.flatten(array)`
875 <a href="#_flattenarray">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6448 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.flatten "See the npm package")
876
877 Flattens `array` a single level deep.
878
879 #### Since
880 0.1.0
881 #### Arguments
882 1. `array` *(Array)*: The array to flatten.
883
884 #### Returns
885 *(Array)*: Returns the new flattened array.
886
887 #### Example
888 ```js
889 _.flatten([1, [2, [3, [4]], 5]]);
890 // => [1, 2, [3, [4]], 5]
891 ```
892 * * *
893
894 <!-- /div -->
895
896 <!-- div -->
897
898 ### <a id="_flattendeeparray"></a>`_.flattenDeep(array)`
899 <a href="#_flattendeeparray">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6467 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.flattendeep "See the npm package")
900
901 Recursively flattens `array`.
902
903 #### Since
904 3.0.0
905 #### Arguments
906 1. `array` *(Array)*: The array to flatten.
907
908 #### Returns
909 *(Array)*: Returns the new flattened array.
910
911 #### Example
912 ```js
913 _.flattenDeep([1, [2, [3, [4]], 5]]);
914 // => [1, 2, 3, 4, 5]
915 ```
916 * * *
917
918 <!-- /div -->
919
920 <!-- div -->
921
922 ### <a id="_flattendeptharray-depth1"></a>`_.flattenDepth(array, [depth=1])`
923 <a href="#_flattendeptharray-depth1">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6492 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.flattendepth "See the npm package")
924
925 Recursively flatten `array` up to `depth` times.
926
927 #### Since
928 4.4.0
929 #### Arguments
930 1. `array` *(Array)*: The array to flatten.
931 2. `[depth=1]` *(number)*: The maximum recursion depth.
932
933 #### Returns
934 *(Array)*: Returns the new flattened array.
935
936 #### Example
937 ```js
938 var array = [1, [2, [3, [4]], 5]];
939
940 _.flattenDepth(array, 1);
941 // => [1, 2, [3, [4]], 5]
942
943 _.flattenDepth(array, 2);
944 // => [1, 2, 3, [4], 5]
945 ```
946 * * *
947
948 <!-- /div -->
949
950 <!-- div -->
951
952 ### <a id="_frompairspairs"></a>`_.fromPairs(pairs)`
953 <a href="#_frompairspairs">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6516 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.frompairs "See the npm package")
954
955 The inverse of `_.toPairs`; this method returns an object composed
956 from key-value `pairs`.
957
958 #### Since
959 4.0.0
960 #### Arguments
961 1. `pairs` *(Array)*: The key-value pairs.
962
963 #### Returns
964 *(Object)*: Returns the new object.
965
966 #### Example
967 ```js
968 _.fromPairs([['fred', 30], ['barney', 40]]);
969 // => { 'fred': 30, 'barney': 40 }
970 ```
971 * * *
972
973 <!-- /div -->
974
975 <!-- div -->
976
977 ### <a id="_headarray"></a>`_.head(array)`
978 <a href="#_headarray">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6546 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.head "See the npm package")
979
980 Gets the first element of `array`.
981
982 #### Since
983 0.1.0
984 #### Aliases
985 *_.first*
986
987 #### Arguments
988 1. `array` *(Array)*: The array to query.
989
990 #### Returns
991 *(&#42;)*: Returns the first element of `array`.
992
993 #### Example
994 ```js
995 _.head([1, 2, 3]);
996 // => 1
997
998 _.head([]);
999 // => undefined
1000 ```
1001 * * *
1002
1003 <!-- /div -->
1004
1005 <!-- div -->
1006
1007 ### <a id="_indexofarray-value-fromindex0"></a>`_.indexOf(array, value, [fromIndex=0])`
1008 <a href="#_indexofarray-value-fromindex0">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6573 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.indexof "See the npm package")
1009
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`.
1014
1015 #### Since
1016 0.1.0
1017 #### Arguments
1018 1. `array` *(Array)*: The array to search.
1019 2. `value` *(&#42;)*: The value to search for.
1020 3. `[fromIndex=0]` *(number)*: The index to search from.
1021
1022 #### Returns
1023 *(number)*: Returns the index of the matched value, else `-1`.
1024
1025 #### Example
1026 ```js
1027 _.indexOf([1, 2, 1, 2], 2);
1028 // => 1
1029
1030 // Search from the `fromIndex`.
1031 _.indexOf([1, 2, 1, 2], 2, 2);
1032 // => 3
1033 ```
1034 * * *
1035
1036 <!-- /div -->
1037
1038 <!-- div -->
1039
1040 ### <a id="_initialarray"></a>`_.initial(array)`
1041 <a href="#_initialarray">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6599 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.initial "See the npm package")
1042
1043 Gets all but the last element of `array`.
1044
1045 #### Since
1046 0.1.0
1047 #### Arguments
1048 1. `array` *(Array)*: The array to query.
1049
1050 #### Returns
1051 *(Array)*: Returns the slice of `array`.
1052
1053 #### Example
1054 ```js
1055 _.initial([1, 2, 3]);
1056 // => [1, 2]
1057 ```
1058 * * *
1059
1060 <!-- /div -->
1061
1062 <!-- div -->
1063
1064 ### <a id="_intersectionarrays"></a>`_.intersection([arrays])`
1065 <a href="#_intersectionarrays">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6620 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.intersection "See the npm package")
1066
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.
1071
1072 #### Since
1073 0.1.0
1074 #### Arguments
1075 1. `[arrays]` *(...Array)*: The arrays to inspect.
1076
1077 #### Returns
1078 *(Array)*: Returns the new array of intersecting values.
1079
1080 #### Example
1081 ```js
1082 _.intersection([2, 1], [4, 2], [1, 2]);
1083 // => [2]
1084 ```
1085 * * *
1086
1087 <!-- /div -->
1088
1089 <!-- div -->
1090
1091 ### <a id="_intersectionbyarrays-iteratee_identity"></a>`_.intersectionBy([arrays], [iteratee=_.identity])`
1092 <a href="#_intersectionbyarrays-iteratee_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6650 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.intersectionby "See the npm package")
1093
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)*.
1098
1099 #### Since
1100 4.0.0
1101 #### Arguments
1102 1. `[arrays]` *(...Array)*: The arrays to inspect.
1103 2. `[iteratee=_.identity]` *(Array|Function|Object|string)*: The iteratee invoked per element.
1104
1105 #### Returns
1106 *(Array)*: Returns the new array of intersecting values.
1107
1108 #### Example
1109 ```js
1110 _.intersectionBy([2.1, 1.2], [4.3, 2.4], Math.floor);
1111 // => [2.1]
1112
1113 // The `_.property` iteratee shorthand.
1114 _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
1115 // => [{ 'x': 1 }]
1116 ```
1117 * * *
1118
1119 <!-- /div -->
1120
1121 <!-- div -->
1122
1123 ### <a id="_intersectionwitharrays-comparator"></a>`_.intersectionWith([arrays], [comparator])`
1124 <a href="#_intersectionwitharrays-comparator">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6685 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.intersectionwith "See the npm package")
1125
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>
1129 *(arrVal, othVal)*.
1130
1131 #### Since
1132 4.0.0
1133 #### Arguments
1134 1. `[arrays]` *(...Array)*: The arrays to inspect.
1135 2. `[comparator]` *(Function)*: The comparator invoked per element.
1136
1137 #### Returns
1138 *(Array)*: Returns the new array of intersecting values.
1139
1140 #### Example
1141 ```js
1142 var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
1143 var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
1144
1145 _.intersectionWith(objects, others, _.isEqual);
1146 // => [{ 'x': 1, 'y': 2 }]
1147 ```
1148 * * *
1149
1150 <!-- /div -->
1151
1152 <!-- div -->
1153
1154 ### <a id="_joinarray-separator-"></a>`_.join(array, [separator=','])`
1155 <a href="#_joinarray-separator-">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6714 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.join "See the npm package")
1156
1157 Converts all elements in `array` into a string separated by `separator`.
1158
1159 #### Since
1160 4.0.0
1161 #### Arguments
1162 1. `array` *(Array)*: The array to convert.
1163 2. `[separator=',']` *(string)*: The element separator.
1164
1165 #### Returns
1166 *(string)*: Returns the joined string.
1167
1168 #### Example
1169 ```js
1170 _.join(['a', 'b', 'c'], '~');
1171 // => 'a~b~c'
1172 ```
1173 * * *
1174
1175 <!-- /div -->
1176
1177 <!-- div -->
1178
1179 ### <a id="_lastarray"></a>`_.last(array)`
1180 <a href="#_lastarray">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6732 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.last "See the npm package")
1181
1182 Gets the last element of `array`.
1183
1184 #### Since
1185 0.1.0
1186 #### Arguments
1187 1. `array` *(Array)*: The array to query.
1188
1189 #### Returns
1190 *(&#42;)*: Returns the last element of `array`.
1191
1192 #### Example
1193 ```js
1194 _.last([1, 2, 3]);
1195 // => 3
1196 ```
1197 * * *
1198
1199 <!-- /div -->
1200
1201 <!-- div -->
1202
1203 ### <a id="_lastindexofarray-value-fromindexarraylength-1"></a>`_.lastIndexOf(array, value, [fromIndex=array.length-1])`
1204 <a href="#_lastindexofarray-value-fromindexarraylength-1">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6758 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.lastindexof "See the npm package")
1205
1206 This method is like `_.indexOf` except that it iterates over elements of
1207 `array` from right to left.
1208
1209 #### Since
1210 0.1.0
1211 #### Arguments
1212 1. `array` *(Array)*: The array to search.
1213 2. `value` *(&#42;)*: The value to search for.
1214 3. `[fromIndex=array.length-1]` *(number)*: The index to search from.
1215
1216 #### Returns
1217 *(number)*: Returns the index of the matched value, else `-1`.
1218
1219 #### Example
1220 ```js
1221 _.lastIndexOf([1, 2, 1, 2], 2);
1222 // => 3
1223
1224 // Search from the `fromIndex`.
1225 _.lastIndexOf([1, 2, 1, 2], 2, 2);
1226 // => 1
1227 ```
1228 * * *
1229
1230 <!-- /div -->
1231
1232 <!-- div -->
1233
1234 ### <a id="_ntharray-n0"></a>`_.nth(array, [n=0])`
1235 <a href="#_ntharray-n0">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6804 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.nth "See the npm package")
1236
1237 Gets the nth element of `array`. If `n` is negative, the nth element
1238 from the end is returned.
1239
1240 #### Since
1241 4.11.0
1242 #### Arguments
1243 1. `array` *(Array)*: The array to query.
1244 2. `[n=0]` *(number)*: The index of the element to return.
1245
1246 #### Returns
1247 *(&#42;)*: Returns the nth element of `array`.
1248
1249 #### Example
1250 ```js
1251 var array = ['a', 'b', 'c', 'd'];
1252
1253 _.nth(array, 1);
1254 // => 'b'
1255
1256 _.nth(array, -2);
1257 // => 'c';
1258 ```
1259 * * *
1260
1261 <!-- /div -->
1262
1263 <!-- div -->
1264
1265 ### <a id="_pullarray-values"></a>`_.pull(array, [values])`
1266 <a href="#_pullarray-values">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6831 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.pull "See the npm package")
1267
1268 Removes all given values from `array` using
1269 [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
1270 for equality comparisons.
1271 <br>
1272 <br>
1273 **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove`
1274 to remove elements from an array by predicate.
1275
1276 #### Since
1277 2.0.0
1278 #### Arguments
1279 1. `array` *(Array)*: The array to modify.
1280 2. `[values]` *(...&#42;)*: The values to remove.
1281
1282 #### Returns
1283 *(Array)*: Returns `array`.
1284
1285 #### Example
1286 ```js
1287 var array = [1, 2, 3, 1, 2, 3];
1288
1289 _.pull(array, 2, 3);
1290 console.log(array);
1291 // => [1, 1]
1292 ```
1293 * * *
1294
1295 <!-- /div -->
1296
1297 <!-- div -->
1298
1299 ### <a id="_pullallarray-values"></a>`_.pullAll(array, values)`
1300 <a href="#_pullallarray-values">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6853 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.pullall "See the npm package")
1301
1302 This method is like `_.pull` except that it accepts an array of values to remove.
1303 <br>
1304 <br>
1305 **Note:** Unlike `_.difference`, this method mutates `array`.
1306
1307 #### Since
1308 4.0.0
1309 #### Arguments
1310 1. `array` *(Array)*: The array to modify.
1311 2. `values` *(Array)*: The values to remove.
1312
1313 #### Returns
1314 *(Array)*: Returns `array`.
1315
1316 #### Example
1317 ```js
1318 var array = [1, 2, 3, 1, 2, 3];
1319
1320 _.pullAll(array, [2, 3]);
1321 console.log(array);
1322 // => [1, 1]
1323 ```
1324 * * *
1325
1326 <!-- /div -->
1327
1328 <!-- div -->
1329
1330 ### <a id="_pullallbyarray-values-iteratee_identity"></a>`_.pullAllBy(array, values, [iteratee=_.identity])`
1331 <a href="#_pullallbyarray-values-iteratee_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6883 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.pullallby "See the npm package")
1332
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)*.
1336 <br>
1337 <br>
1338 **Note:** Unlike `_.differenceBy`, this method mutates `array`.
1339
1340 #### Since
1341 4.0.0
1342 #### Arguments
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.
1346
1347 #### Returns
1348 *(Array)*: Returns `array`.
1349
1350 #### Example
1351 ```js
1352 var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];
1353
1354 _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x');
1355 console.log(array);
1356 // => [{ 'x': 2 }]
1357 ```
1358 * * *
1359
1360 <!-- /div -->
1361
1362 <!-- div -->
1363
1364 ### <a id="_pullallwitharray-values-comparator"></a>`_.pullAllWith(array, values, [comparator])`
1365 <a href="#_pullallwitharray-values-comparator">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6912 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.pullallwith "See the npm package")
1366
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)*.
1370 <br>
1371 <br>
1372 **Note:** Unlike `_.differenceWith`, this method mutates `array`.
1373
1374 #### Since
1375 4.6.0
1376 #### Arguments
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.
1380
1381 #### Returns
1382 *(Array)*: Returns `array`.
1383
1384 #### Example
1385 ```js
1386 var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }];
1387
1388 _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual);
1389 console.log(array);
1390 // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }]
1391 ```
1392 * * *
1393
1394 <!-- /div -->
1395
1396 <!-- div -->
1397
1398 ### <a id="_pullatarray-indexes"></a>`_.pullAt(array, [indexes])`
1399 <a href="#_pullatarray-indexes">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6942 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.pullat "See the npm package")
1400
1401 Removes elements from `array` corresponding to `indexes` and returns an
1402 array of removed elements.
1403 <br>
1404 <br>
1405 **Note:** Unlike `_.at`, this method mutates `array`.
1406
1407 #### Since
1408 3.0.0
1409 #### Arguments
1410 1. `array` *(Array)*: The array to modify.
1411 2. `[indexes]` *(...(number|number&#91;&#93;))*: The indexes of elements to remove.
1412
1413 #### Returns
1414 *(Array)*: Returns the new array of removed elements.
1415
1416 #### Example
1417 ```js
1418 var array = [5, 10, 15, 20];
1419 var evens = _.pullAt(array, 1, 3);
1420
1421 console.log(array);
1422 // => [5, 15]
1423
1424 console.log(evens);
1425 // => [10, 20]
1426 ```
1427 * * *
1428
1429 <!-- /div -->
1430
1431 <!-- div -->
1432
1433 ### <a id="_removearray-predicate_identity"></a>`_.remove(array, [predicate=_.identity])`
1434 <a href="#_removearray-predicate_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L6984 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.remove "See the npm package")
1435
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)*.
1439 <br>
1440 <br>
1441 **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull`
1442 to pull elements from an array by value.
1443
1444 #### Since
1445 2.0.0
1446 #### Arguments
1447 1. `array` *(Array)*: The array to modify.
1448 2. `[predicate=_.identity]` *(Array|Function|Object|string)*: The function invoked per iteration.
1449
1450 #### Returns
1451 *(Array)*: Returns the new array of removed elements.
1452
1453 #### Example
1454 ```js
1455 var array = [1, 2, 3, 4];
1456 var evens = _.remove(array, function(n) {
1457   return n % 2 == 0;
1458 });
1459
1460 console.log(array);
1461 // => [1, 3]
1462
1463 console.log(evens);
1464 // => [2, 4]
1465 ```
1466 * * *
1467
1468 <!-- /div -->
1469
1470 <!-- div -->
1471
1472 ### <a id="_reversearray"></a>`_.reverse(array)`
1473 <a href="#_reversearray">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7028 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.reverse "See the npm package")
1474
1475 Reverses `array` so that the first element becomes the last, the second
1476 element becomes the second to last, and so on.
1477 <br>
1478 <br>
1479 **Note:** This method mutates `array` and is based on
1480 [`Array#reverse`](https://mdn.io/Array/reverse).
1481
1482 #### Since
1483 4.0.0
1484 #### Arguments
1485 1. `array` *(Array)*: The array to modify.
1486
1487 #### Returns
1488 *(Array)*: Returns `array`.
1489
1490 #### Example
1491 ```js
1492 var array = [1, 2, 3];
1493
1494 _.reverse(array);
1495 // => [3, 2, 1]
1496
1497 console.log(array);
1498 // => [3, 2, 1]
1499 ```
1500 * * *
1501
1502 <!-- /div -->
1503
1504 <!-- div -->
1505
1506 ### <a id="_slicearray-start0-endarraylength"></a>`_.slice(array, [start=0], [end=array.length])`
1507 <a href="#_slicearray-start0-endarraylength">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7048 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.slice "See the npm package")
1508
1509 Creates a slice of `array` from `start` up to, but not including, `end`.
1510 <br>
1511 <br>
1512 **Note:** This method is used instead of
1513 [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are
1514 returned.
1515
1516 #### Since
1517 3.0.0
1518 #### Arguments
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.
1522
1523 #### Returns
1524 *(Array)*: Returns the slice of `array`.
1525
1526 * * *
1527
1528 <!-- /div -->
1529
1530 <!-- div -->
1531
1532 ### <a id="_sortedindexarray-value"></a>`_.sortedIndex(array, value)`
1533 <a href="#_sortedindexarray-value">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7084 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.sortedindex "See the npm package")
1534
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.
1537
1538 #### Since
1539 0.1.0
1540 #### Arguments
1541 1. `array` *(Array)*: The sorted array to inspect.
1542 2. `value` *(&#42;)*: The value to evaluate.
1543
1544 #### Returns
1545 *(number)*: Returns the index at which `value` should be inserted into `array`.
1546
1547 #### Example
1548 ```js
1549 _.sortedIndex([30, 50], 40);
1550 // => 1
1551
1552 _.sortedIndex([4, 5], 4);
1553 // => 0
1554 ```
1555 * * *
1556
1557 <!-- /div -->
1558
1559 <!-- div -->
1560
1561 ### <a id="_sortedindexbyarray-value-iteratee_identity"></a>`_.sortedIndexBy(array, value, [iteratee=_.identity])`
1562 <a href="#_sortedindexbyarray-value-iteratee_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7114 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.sortedindexby "See the npm package")
1563
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)*.
1567
1568 #### Since
1569 4.0.0
1570 #### Arguments
1571 1. `array` *(Array)*: The sorted array to inspect.
1572 2. `value` *(&#42;)*: The value to evaluate.
1573 3. `[iteratee=_.identity]` *(Array|Function|Object|string)*: The iteratee invoked per element.
1574
1575 #### Returns
1576 *(number)*: Returns the index at which `value` should be inserted into `array`.
1577
1578 #### Example
1579 ```js
1580 var dict = { 'thirty': 30, 'forty': 40, 'fifty': 50 };
1581
1582 _.sortedIndexBy(['thirty', 'fifty'], 'forty', _.propertyOf(dict));
1583 // => 1
1584
1585 // The `_.property` iteratee shorthand.
1586 _.sortedIndexBy([{ 'x': 4 }, { 'x': 5 }], { 'x': 4 }, 'x');
1587 // => 0
1588 ```
1589 * * *
1590
1591 <!-- /div -->
1592
1593 <!-- div -->
1594
1595 ### <a id="_sortedindexofarray-value"></a>`_.sortedIndexOf(array, value)`
1596 <a href="#_sortedindexofarray-value">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7134 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.sortedindexof "See the npm package")
1597
1598 This method is like `_.indexOf` except that it performs a binary
1599 search on a sorted `array`.
1600
1601 #### Since
1602 4.0.0
1603 #### Arguments
1604 1. `array` *(Array)*: The array to search.
1605 2. `value` *(&#42;)*: The value to search for.
1606
1607 #### Returns
1608 *(number)*: Returns the index of the matched value, else `-1`.
1609
1610 #### Example
1611 ```js
1612 _.sortedIndexOf([1, 1, 2, 2], 2);
1613 // => 2
1614 ```
1615 * * *
1616
1617 <!-- /div -->
1618
1619 <!-- div -->
1620
1621 ### <a id="_sortedlastindexarray-value"></a>`_.sortedLastIndex(array, value)`
1622 <a href="#_sortedlastindexarray-value">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7163 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.sortedlastindex "See the npm package")
1623
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.
1627
1628 #### Since
1629 3.0.0
1630 #### Arguments
1631 1. `array` *(Array)*: The sorted array to inspect.
1632 2. `value` *(&#42;)*: The value to evaluate.
1633
1634 #### Returns
1635 *(number)*: Returns the index at which `value` should be inserted into `array`.
1636
1637 #### Example
1638 ```js
1639 _.sortedLastIndex([4, 5], 4);
1640 // => 1
1641 ```
1642 * * *
1643
1644 <!-- /div -->
1645
1646 <!-- div -->
1647
1648 ### <a id="_sortedlastindexbyarray-value-iteratee_identity"></a>`_.sortedLastIndexBy(array, value, [iteratee=_.identity])`
1649 <a href="#_sortedlastindexbyarray-value-iteratee_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7188 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.sortedlastindexby "See the npm package")
1650
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)*.
1654
1655 #### Since
1656 4.0.0
1657 #### Arguments
1658 1. `array` *(Array)*: The sorted array to inspect.
1659 2. `value` *(&#42;)*: The value to evaluate.
1660 3. `[iteratee=_.identity]` *(Array|Function|Object|string)*: The iteratee invoked per element.
1661
1662 #### Returns
1663 *(number)*: Returns the index at which `value` should be inserted into `array`.
1664
1665 #### Example
1666 ```js
1667 // The `_.property` iteratee shorthand.
1668 _.sortedLastIndexBy([{ 'x': 4 }, { 'x': 5 }], { 'x': 4 }, 'x');
1669 // => 1
1670 ```
1671 * * *
1672
1673 <!-- /div -->
1674
1675 <!-- div -->
1676
1677 ### <a id="_sortedlastindexofarray-value"></a>`_.sortedLastIndexOf(array, value)`
1678 <a href="#_sortedlastindexofarray-value">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7208 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.sortedlastindexof "See the npm package")
1679
1680 This method is like `_.lastIndexOf` except that it performs a binary
1681 search on a sorted `array`.
1682
1683 #### Since
1684 4.0.0
1685 #### Arguments
1686 1. `array` *(Array)*: The array to search.
1687 2. `value` *(&#42;)*: The value to search for.
1688
1689 #### Returns
1690 *(number)*: Returns the index of the matched value, else `-1`.
1691
1692 #### Example
1693 ```js
1694 _.sortedLastIndexOf([1, 1, 2, 2], 2);
1695 // => 3
1696 ```
1697 * * *
1698
1699 <!-- /div -->
1700
1701 <!-- div -->
1702
1703 ### <a id="_sorteduniqarray"></a>`_.sortedUniq(array)`
1704 <a href="#_sorteduniqarray">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7234 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.sorteduniq "See the npm package")
1705
1706 This method is like `_.uniq` except that it's designed and optimized
1707 for sorted arrays.
1708
1709 #### Since
1710 4.0.0
1711 #### Arguments
1712 1. `array` *(Array)*: The array to inspect.
1713
1714 #### Returns
1715 *(Array)*: Returns the new duplicate free array.
1716
1717 #### Example
1718 ```js
1719 _.sortedUniq([1, 1, 2]);
1720 // => [1, 2]
1721 ```
1722 * * *
1723
1724 <!-- /div -->
1725
1726 <!-- div -->
1727
1728 ### <a id="_sorteduniqbyarray-iteratee"></a>`_.sortedUniqBy(array, [iteratee])`
1729 <a href="#_sorteduniqbyarray-iteratee">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7256 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.sorteduniqby "See the npm package")
1730
1731 This method is like `_.uniqBy` except that it's designed and optimized
1732 for sorted arrays.
1733
1734 #### Since
1735 4.0.0
1736 #### Arguments
1737 1. `array` *(Array)*: The array to inspect.
1738 2. `[iteratee]` *(Function)*: The iteratee invoked per element.
1739
1740 #### Returns
1741 *(Array)*: Returns the new duplicate free array.
1742
1743 #### Example
1744 ```js
1745 _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor);
1746 // => [1.1, 2.3]
1747 ```
1748 * * *
1749
1750 <!-- /div -->
1751
1752 <!-- div -->
1753
1754 ### <a id="_tailarray"></a>`_.tail(array)`
1755 <a href="#_tailarray">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7276 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.tail "See the npm package")
1756
1757 Gets all but the first element of `array`.
1758
1759 #### Since
1760 4.0.0
1761 #### Arguments
1762 1. `array` *(Array)*: The array to query.
1763
1764 #### Returns
1765 *(Array)*: Returns the slice of `array`.
1766
1767 #### Example
1768 ```js
1769 _.tail([1, 2, 3]);
1770 // => [2, 3]
1771 ```
1772 * * *
1773
1774 <!-- /div -->
1775
1776 <!-- div -->
1777
1778 ### <a id="_takearray-n1"></a>`_.take(array, [n=1])`
1779 <a href="#_takearray-n1">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7305 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.take "See the npm package")
1780
1781 Creates a slice of `array` with `n` elements taken from the beginning.
1782
1783 #### Since
1784 0.1.0
1785 #### Arguments
1786 1. `array` *(Array)*: The array to query.
1787 2. `[n=1]` *(number)*: The number of elements to take.
1788
1789 #### Returns
1790 *(Array)*: Returns the slice of `array`.
1791
1792 #### Example
1793 ```js
1794 _.take([1, 2, 3]);
1795 // => [1]
1796
1797 _.take([1, 2, 3], 2);
1798 // => [1, 2]
1799
1800 _.take([1, 2, 3], 5);
1801 // => [1, 2, 3]
1802
1803 _.take([1, 2, 3], 0);
1804 // => []
1805 ```
1806 * * *
1807
1808 <!-- /div -->
1809
1810 <!-- div -->
1811
1812 ### <a id="_takerightarray-n1"></a>`_.takeRight(array, [n=1])`
1813 <a href="#_takerightarray-n1">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7338 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.takeright "See the npm package")
1814
1815 Creates a slice of `array` with `n` elements taken from the end.
1816
1817 #### Since
1818 3.0.0
1819 #### Arguments
1820 1. `array` *(Array)*: The array to query.
1821 2. `[n=1]` *(number)*: The number of elements to take.
1822
1823 #### Returns
1824 *(Array)*: Returns the slice of `array`.
1825
1826 #### Example
1827 ```js
1828 _.takeRight([1, 2, 3]);
1829 // => [3]
1830
1831 _.takeRight([1, 2, 3], 2);
1832 // => [2, 3]
1833
1834 _.takeRight([1, 2, 3], 5);
1835 // => [1, 2, 3]
1836
1837 _.takeRight([1, 2, 3], 0);
1838 // => []
1839 ```
1840 * * *
1841
1842 <!-- /div -->
1843
1844 <!-- div -->
1845
1846 ### <a id="_takerightwhilearray-predicate_identity"></a>`_.takeRightWhile(array, [predicate=_.identity])`
1847 <a href="#_takerightwhilearray-predicate_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7384 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.takerightwhile "See the npm package")
1848
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)*.
1852
1853 #### Since
1854 3.0.0
1855 #### Arguments
1856 1. `array` *(Array)*: The array to query.
1857 2. `[predicate=_.identity]` *(Array|Function|Object|string)*: The function invoked per iteration.
1858
1859 #### Returns
1860 *(Array)*: Returns the slice of `array`.
1861
1862 #### Example
1863 ```js
1864 var users = [
1865   { 'user': 'barney',  'active': true },
1866   { 'user': 'fred',    'active': false },
1867   { 'user': 'pebbles', 'active': false }
1868 ];
1869
1870 _.takeRightWhile(users, function(o) { return !o.active; });
1871 // => objects for ['fred', 'pebbles']
1872
1873 // The `_.matches` iteratee shorthand.
1874 _.takeRightWhile(users, { 'user': 'pebbles', 'active': false });
1875 // => objects for ['pebbles']
1876
1877 // The `_.matchesProperty` iteratee shorthand.
1878 _.takeRightWhile(users, ['active', false]);
1879 // => objects for ['fred', 'pebbles']
1880
1881 // The `_.property` iteratee shorthand.
1882 _.takeRightWhile(users, 'active');
1883 // => []
1884 ```
1885 * * *
1886
1887 <!-- /div -->
1888
1889 <!-- div -->
1890
1891 ### <a id="_takewhilearray-predicate_identity"></a>`_.takeWhile(array, [predicate=_.identity])`
1892 <a href="#_takewhilearray-predicate_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7426 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.takewhile "See the npm package")
1893
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)*.
1897
1898 #### Since
1899 3.0.0
1900 #### Arguments
1901 1. `array` *(Array)*: The array to query.
1902 2. `[predicate=_.identity]` *(Array|Function|Object|string)*: The function invoked per iteration.
1903
1904 #### Returns
1905 *(Array)*: Returns the slice of `array`.
1906
1907 #### Example
1908 ```js
1909 var users = [
1910   { 'user': 'barney',  'active': false },
1911   { 'user': 'fred',    'active': false},
1912   { 'user': 'pebbles', 'active': true }
1913 ];
1914
1915 _.takeWhile(users, function(o) { return !o.active; });
1916 // => objects for ['barney', 'fred']
1917
1918 // The `_.matches` iteratee shorthand.
1919 _.takeWhile(users, { 'user': 'barney', 'active': false });
1920 // => objects for ['barney']
1921
1922 // The `_.matchesProperty` iteratee shorthand.
1923 _.takeWhile(users, ['active', false]);
1924 // => objects for ['barney', 'fred']
1925
1926 // The `_.property` iteratee shorthand.
1927 _.takeWhile(users, 'active');
1928 // => []
1929 ```
1930 * * *
1931
1932 <!-- /div -->
1933
1934 <!-- div -->
1935
1936 ### <a id="_unionarrays"></a>`_.union([arrays])`
1937 <a href="#_unionarrays">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7448 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.union "See the npm package")
1938
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.
1942
1943 #### Since
1944 0.1.0
1945 #### Arguments
1946 1. `[arrays]` *(...Array)*: The arrays to inspect.
1947
1948 #### Returns
1949 *(Array)*: Returns the new array of combined values.
1950
1951 #### Example
1952 ```js
1953 _.union([2, 1], [4, 2], [1, 2]);
1954 // => [2, 1, 4]
1955 ```
1956 * * *
1957
1958 <!-- /div -->
1959
1960 <!-- div -->
1961
1962 ### <a id="_unionbyarrays-iteratee_identity"></a>`_.unionBy([arrays], [iteratee=_.identity])`
1963 <a href="#_unionbyarrays-iteratee_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7475 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.unionby "See the npm package")
1964
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>
1968 *(value)*.
1969
1970 #### Since
1971 4.0.0
1972 #### Arguments
1973 1. `[arrays]` *(...Array)*: The arrays to inspect.
1974 2. `[iteratee=_.identity]` *(Array|Function|Object|string)*: The iteratee invoked per element.
1975
1976 #### Returns
1977 *(Array)*: Returns the new array of combined values.
1978
1979 #### Example
1980 ```js
1981 _.unionBy([2.1, 1.2], [4.3, 2.4], Math.floor);
1982 // => [2.1, 1.2, 4.3]
1983
1984 // The `_.property` iteratee shorthand.
1985 _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
1986 // => [{ 'x': 1 }, { 'x': 2 }]
1987 ```
1988 * * *
1989
1990 <!-- /div -->
1991
1992 <!-- div -->
1993
1994 ### <a id="_unionwitharrays-comparator"></a>`_.unionWith([arrays], [comparator])`
1995 <a href="#_unionwitharrays-comparator">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7503 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.unionwith "See the npm package")
1996
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)*.
2000
2001 #### Since
2002 4.0.0
2003 #### Arguments
2004 1. `[arrays]` *(...Array)*: The arrays to inspect.
2005 2. `[comparator]` *(Function)*: The comparator invoked per element.
2006
2007 #### Returns
2008 *(Array)*: Returns the new array of combined values.
2009
2010 #### Example
2011 ```js
2012 var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
2013 var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
2014
2015 _.unionWith(objects, others, _.isEqual);
2016 // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
2017 ```
2018 * * *
2019
2020 <!-- /div -->
2021
2022 <!-- div -->
2023
2024 ### <a id="_uniqarray"></a>`_.uniq(array)`
2025 <a href="#_uniqarray">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7528 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.uniq "See the npm package")
2026
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
2030 element is kept.
2031
2032 #### Since
2033 0.1.0
2034 #### Arguments
2035 1. `array` *(Array)*: The array to inspect.
2036
2037 #### Returns
2038 *(Array)*: Returns the new duplicate free array.
2039
2040 #### Example
2041 ```js
2042 _.uniq([2, 1, 2]);
2043 // => [2, 1]
2044 ```
2045 * * *
2046
2047 <!-- /div -->
2048
2049 <!-- div -->
2050
2051 ### <a id="_uniqbyarray-iteratee_identity"></a>`_.uniqBy(array, [iteratee=_.identity])`
2052 <a href="#_uniqbyarray-iteratee_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7556 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.uniqby "See the npm package")
2053
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)*.
2057
2058 #### Since
2059 4.0.0
2060 #### Arguments
2061 1. `array` *(Array)*: The array to inspect.
2062 2. `[iteratee=_.identity]` *(Array|Function|Object|string)*: The iteratee invoked per element.
2063
2064 #### Returns
2065 *(Array)*: Returns the new duplicate free array.
2066
2067 #### Example
2068 ```js
2069 _.uniqBy([2.1, 1.2, 2.3], Math.floor);
2070 // => [2.1, 1.2]
2071
2072 // The `_.property` iteratee shorthand.
2073 _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');
2074 // => [{ 'x': 1 }, { 'x': 2 }]
2075 ```
2076 * * *
2077
2078 <!-- /div -->
2079
2080 <!-- div -->
2081
2082 ### <a id="_uniqwitharray-comparator"></a>`_.uniqWith(array, [comparator])`
2083 <a href="#_uniqwitharray-comparator">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7581 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.uniqwith "See the npm package")
2084
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)*.
2088
2089 #### Since
2090 4.0.0
2091 #### Arguments
2092 1. `array` *(Array)*: The array to inspect.
2093 2. `[comparator]` *(Function)*: The comparator invoked per element.
2094
2095 #### Returns
2096 *(Array)*: Returns the new duplicate free array.
2097
2098 #### Example
2099 ```js
2100 var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 },  { 'x': 1, 'y': 2 }];
2101
2102 _.uniqWith(objects, _.isEqual);
2103 // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]
2104 ```
2105 * * *
2106
2107 <!-- /div -->
2108
2109 <!-- div -->
2110
2111 ### <a id="_unziparray"></a>`_.unzip(array)`
2112 <a href="#_unziparray">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7606 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.unzip "See the npm package")
2113
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
2116 configuration.
2117
2118 #### Since
2119 1.2.0
2120 #### Arguments
2121 1. `array` *(Array)*: The array of grouped elements to process.
2122
2123 #### Returns
2124 *(Array)*: Returns the new array of regrouped elements.
2125
2126 #### Example
2127 ```js
2128 var zipped = _.zip(['fred', 'barney'], [30, 40], [true, false]);
2129 // => [['fred', 30, true], ['barney', 40, false]]
2130
2131 _.unzip(zipped);
2132 // => [['fred', 'barney'], [30, 40], [true, false]]
2133 ```
2134 * * *
2135
2136 <!-- /div -->
2137
2138 <!-- div -->
2139
2140 ### <a id="_unzipwitharray-iteratee_identity"></a>`_.unzipWith(array, [iteratee=_.identity])`
2141 <a href="#_unzipwitharray-iteratee_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7643 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.unzipwith "See the npm package")
2142
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)*.
2146
2147 #### Since
2148 3.8.0
2149 #### Arguments
2150 1. `array` *(Array)*: The array of grouped elements to process.
2151 2. `[iteratee=_.identity]` *(Function)*: The function to combine regrouped values.
2152
2153 #### Returns
2154 *(Array)*: Returns the new array of regrouped elements.
2155
2156 #### Example
2157 ```js
2158 var zipped = _.zip([1, 2], [10, 20], [100, 200]);
2159 // => [[1, 10, 100], [2, 20, 200]]
2160
2161 _.unzipWith(zipped, _.add);
2162 // => [3, 30, 300]
2163 ```
2164 * * *
2165
2166 <!-- /div -->
2167
2168 <!-- div -->
2169
2170 ### <a id="_withoutarray-values"></a>`_.without(array, [values])`
2171 <a href="#_withoutarray-values">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7674 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.without "See the npm package")
2172
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.
2176
2177 #### Since
2178 0.1.0
2179 #### Arguments
2180 1. `array` *(Array)*: The array to filter.
2181 2. `[values]` *(...&#42;)*: The values to exclude.
2182
2183 #### Returns
2184 *(Array)*: Returns the new array of filtered values.
2185
2186 #### Example
2187 ```js
2188 _.without([1, 2, 1, 3], 1, 2);
2189 // => [3]
2190 ```
2191 * * *
2192
2193 <!-- /div -->
2194
2195 <!-- div -->
2196
2197 ### <a id="_xorarrays"></a>`_.xor([arrays])`
2198 <a href="#_xorarrays">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7698 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.xor "See the npm package")
2199
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.
2204
2205 #### Since
2206 2.4.0
2207 #### Arguments
2208 1. `[arrays]` *(...Array)*: The arrays to inspect.
2209
2210 #### Returns
2211 *(Array)*: Returns the new array of values.
2212
2213 #### Example
2214 ```js
2215 _.xor([2, 1], [4, 2]);
2216 // => [1, 4]
2217 ```
2218 * * *
2219
2220 <!-- /div -->
2221
2222 <!-- div -->
2223
2224 ### <a id="_xorbyarrays-iteratee_identity"></a>`_.xorBy([arrays], [iteratee=_.identity])`
2225 <a href="#_xorbyarrays-iteratee_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7725 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.xorby "See the npm package")
2226
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>
2230 *(value)*.
2231
2232 #### Since
2233 4.0.0
2234 #### Arguments
2235 1. `[arrays]` *(...Array)*: The arrays to inspect.
2236 2. `[iteratee=_.identity]` *(Array|Function|Object|string)*: The iteratee invoked per element.
2237
2238 #### Returns
2239 *(Array)*: Returns the new array of values.
2240
2241 #### Example
2242 ```js
2243 _.xorBy([2.1, 1.2], [4.3, 2.4], Math.floor);
2244 // => [1.2, 4.3]
2245
2246 // The `_.property` iteratee shorthand.
2247 _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
2248 // => [{ 'x': 2 }]
2249 ```
2250 * * *
2251
2252 <!-- /div -->
2253
2254 <!-- div -->
2255
2256 ### <a id="_xorwitharrays-comparator"></a>`_.xorWith([arrays], [comparator])`
2257 <a href="#_xorwitharrays-comparator">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7753 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.xorwith "See the npm package")
2258
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)*.
2262
2263 #### Since
2264 4.0.0
2265 #### Arguments
2266 1. `[arrays]` *(...Array)*: The arrays to inspect.
2267 2. `[comparator]` *(Function)*: The comparator invoked per element.
2268
2269 #### Returns
2270 *(Array)*: Returns the new array of values.
2271
2272 #### Example
2273 ```js
2274 var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
2275 var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
2276
2277 _.xorWith(objects, others, _.isEqual);
2278 // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
2279 ```
2280 * * *
2281
2282 <!-- /div -->
2283
2284 <!-- div -->
2285
2286 ### <a id="_ziparrays"></a>`_.zip([arrays])`
2287 <a href="#_ziparrays">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7777 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.zip "See the npm package")
2288
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.
2292
2293 #### Since
2294 0.1.0
2295 #### Arguments
2296 1. `[arrays]` *(...Array)*: The arrays to process.
2297
2298 #### Returns
2299 *(Array)*: Returns the new array of grouped elements.
2300
2301 #### Example
2302 ```js
2303 _.zip(['fred', 'barney'], [30, 40], [true, false]);
2304 // => [['fred', 30, true], ['barney', 40, false]]
2305 ```
2306 * * *
2307
2308 <!-- /div -->
2309
2310 <!-- div -->
2311
2312 ### <a id="_zipobjectprops-values"></a>`_.zipObject([props=[]], [values=[]])`
2313 <a href="#_zipobjectprops-values">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7795 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.zipobject "See the npm package")
2314
2315 This method is like `_.fromPairs` except that it accepts two arrays,
2316 one of property identifiers and one of corresponding values.
2317
2318 #### Since
2319 0.4.0
2320 #### Arguments
2321 1. `[props=[]]` *(Array)*: The property identifiers.
2322 2. `[values=[]]` *(Array)*: The property values.
2323
2324 #### Returns
2325 *(Object)*: Returns the new object.
2326
2327 #### Example
2328 ```js
2329 _.zipObject(['a', 'b'], [1, 2]);
2330 // => { 'a': 1, 'b': 2 }
2331 ```
2332 * * *
2333
2334 <!-- /div -->
2335
2336 <!-- div -->
2337
2338 ### <a id="_zipobjectdeepprops-values"></a>`_.zipObjectDeep([props=[]], [values=[]])`
2339 <a href="#_zipobjectdeepprops-values">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7814 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.zipobjectdeep "See the npm package")
2340
2341 This method is like `_.zipObject` except that it supports property paths.
2342
2343 #### Since
2344 4.1.0
2345 #### Arguments
2346 1. `[props=[]]` *(Array)*: The property identifiers.
2347 2. `[values=[]]` *(Array)*: The property values.
2348
2349 #### Returns
2350 *(Object)*: Returns the new object.
2351
2352 #### Example
2353 ```js
2354 _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]);
2355 // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } }
2356 ```
2357 * * *
2358
2359 <!-- /div -->
2360
2361 <!-- div -->
2362
2363 ### <a id="_zipwitharrays-iteratee_identity"></a>`_.zipWith([arrays], [iteratee=_.identity])`
2364 <a href="#_zipwitharrays-iteratee_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7837 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.zipwith "See the npm package")
2365
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)*.
2369
2370 #### Since
2371 3.8.0
2372 #### Arguments
2373 1. `[arrays]` *(...Array)*: The arrays to process.
2374 2. `[iteratee=_.identity]` *(Function)*: The function to combine grouped values.
2375
2376 #### Returns
2377 *(Array)*: Returns the new array of grouped elements.
2378
2379 #### Example
2380 ```js
2381 _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) {
2382   return a + b + c;
2383 });
2384 // => [111, 222]
2385 ```
2386 * * *
2387
2388 <!-- /div -->
2389
2390 <!-- /div -->
2391
2392 <!-- div -->
2393
2394 ## `“Collection” Methods`
2395
2396 <!-- div -->
2397
2398 ### <a id="_countbycollection-iteratee_identity"></a>`_.countBy(collection, [iteratee=_.identity])`
2399 <a href="#_countbycollection-iteratee_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L8220 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.countby "See the npm package")
2400
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)*.
2405
2406 #### Since
2407 0.5.0
2408 #### Arguments
2409 1. `collection` *(Array|Object)*: The collection to iterate over.
2410 2. `[iteratee=_.identity]` *(Array|Function|Object|string)*: The iteratee to transform keys.
2411
2412 #### Returns
2413 *(Object)*: Returns the composed aggregate object.
2414
2415 #### Example
2416 ```js
2417 _.countBy([6.1, 4.2, 6.3], Math.floor);
2418 // => { '4': 1, '6': 2 }
2419
2420 _.countBy(['one', 'two', 'three'], 'length');
2421 // => { '3': 2, '5': 1 }
2422 ```
2423 * * *
2424
2425 <!-- /div -->
2426
2427 <!-- div -->
2428
2429 ### <a id="_everycollection-predicate_identity"></a>`_.every(collection, [predicate=_.identity])`
2430 <a href="#_everycollection-predicate_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L8261 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.every "See the npm package")
2431
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)*.
2435
2436 #### Since
2437 0.1.0
2438 #### Arguments
2439 1. `collection` *(Array|Object)*: The collection to iterate over.
2440 2. `[predicate=_.identity]` *(Array|Function|Object|string)*: The function invoked per iteration.
2441
2442 #### Returns
2443 *(boolean)*: Returns `true` if all elements pass the predicate check, else `false`.
2444
2445 #### Example
2446 ```js
2447 _.every([true, 1, null, 'yes'], Boolean);
2448 // => false
2449
2450 var users = [
2451   { 'user': 'barney', 'age': 36, 'active': false },
2452   { 'user': 'fred',   'age': 40, 'active': false }
2453 ];
2454
2455 // The `_.matches` iteratee shorthand.
2456 _.every(users, { 'user': 'barney', 'active': false });
2457 // => false
2458
2459 // The `_.matchesProperty` iteratee shorthand.
2460 _.every(users, ['active', false]);
2461 // => true
2462
2463 // The `_.property` iteratee shorthand.
2464 _.every(users, 'active');
2465 // => false
2466 ```
2467 * * *
2468
2469 <!-- /div -->
2470
2471 <!-- div -->
2472
2473 ### <a id="_filtercollection-predicate_identity"></a>`_.filter(collection, [predicate=_.identity])`
2474 <a href="#_filtercollection-predicate_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L8305 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.filter "See the npm package")
2475
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)*.
2479
2480 #### Since
2481 0.1.0
2482 #### Arguments
2483 1. `collection` *(Array|Object)*: The collection to iterate over.
2484 2. `[predicate=_.identity]` *(Array|Function|Object|string)*: The function invoked per iteration.
2485
2486 #### Returns
2487 *(Array)*: Returns the new filtered array.
2488
2489 #### Example
2490 ```js
2491 var users = [
2492   { 'user': 'barney', 'age': 36, 'active': true },
2493   { 'user': 'fred',   'age': 40, 'active': false }
2494 ];
2495
2496 _.filter(users, function(o) { return !o.active; });
2497 // => objects for ['fred']
2498
2499 // The `_.matches` iteratee shorthand.
2500 _.filter(users, { 'age': 36, 'active': true });
2501 // => objects for ['barney']
2502
2503 // The `_.matchesProperty` iteratee shorthand.
2504 _.filter(users, ['active', false]);
2505 // => objects for ['fred']
2506
2507 // The `_.property` iteratee shorthand.
2508 _.filter(users, 'active');
2509 // => objects for ['barney']
2510 ```
2511 * * *
2512
2513 <!-- /div -->
2514
2515 <!-- div -->
2516
2517 ### <a id="_findcollection-predicate_identity"></a>`_.find(collection, [predicate=_.identity])`
2518 <a href="#_findcollection-predicate_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L8346 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.find "See the npm package")
2519
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)*.
2523
2524 #### Since
2525 0.1.0
2526 #### Arguments
2527 1. `collection` *(Array|Object)*: The collection to search.
2528 2. `[predicate=_.identity]` *(Array|Function|Object|string)*: The function invoked per iteration.
2529
2530 #### Returns
2531 *(&#42;)*: Returns the matched element, else `undefined`.
2532
2533 #### Example
2534 ```js
2535 var users = [
2536   { 'user': 'barney',  'age': 36, 'active': true },
2537   { 'user': 'fred',    'age': 40, 'active': false },
2538   { 'user': 'pebbles', 'age': 1,  'active': true }
2539 ];
2540
2541 _.find(users, function(o) { return o.age < 40; });
2542 // => object for 'barney'
2543
2544 // The `_.matches` iteratee shorthand.
2545 _.find(users, { 'age': 1, 'active': true });
2546 // => object for 'pebbles'
2547
2548 // The `_.matchesProperty` iteratee shorthand.
2549 _.find(users, ['active', false]);
2550 // => object for 'fred'
2551
2552 // The `_.property` iteratee shorthand.
2553 _.find(users, 'active');
2554 // => object for 'barney'
2555 ```
2556 * * *
2557
2558 <!-- /div -->
2559
2560 <!-- div -->
2561
2562 ### <a id="_findlastcollection-predicate_identity"></a>`_.findLast(collection, [predicate=_.identity])`
2563 <a href="#_findlastcollection-predicate_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L8374 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.findlast "See the npm package")
2564
2565 This method is like `_.find` except that it iterates over elements of
2566 `collection` from right to left.
2567
2568 #### Since
2569 2.0.0
2570 #### Arguments
2571 1. `collection` *(Array|Object)*: The collection to search.
2572 2. `[predicate=_.identity]` *(Array|Function|Object|string)*: The function invoked per iteration.
2573
2574 #### Returns
2575 *(&#42;)*: Returns the matched element, else `undefined`.
2576
2577 #### Example
2578 ```js
2579 _.findLast([1, 2, 3, 4], function(n) {
2580   return n % 2 == 1;
2581 });
2582 // => 3
2583 ```
2584 * * *
2585
2586 <!-- /div -->
2587
2588 <!-- div -->
2589
2590 ### <a id="_flatmapcollection-iteratee_identity"></a>`_.flatMap(collection, [iteratee=_.identity])`
2591 <a href="#_flatmapcollection-iteratee_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L8405 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.flatmap "See the npm package")
2592
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)*.
2596
2597 #### Since
2598 4.0.0
2599 #### Arguments
2600 1. `collection` *(Array|Object)*: The collection to iterate over.
2601 2. `[iteratee=_.identity]` *(Array|Function|Object|string)*: The function invoked per iteration.
2602
2603 #### Returns
2604 *(Array)*: Returns the new flattened array.
2605
2606 #### Example
2607 ```js
2608 function duplicate(n) {
2609   return [n, n];
2610 }
2611
2612 _.flatMap([1, 2], duplicate);
2613 // => [1, 1, 2, 2]
2614 ```
2615 * * *
2616
2617 <!-- /div -->
2618
2619 <!-- div -->
2620
2621 ### <a id="_flatmapdeepcollection-iteratee_identity"></a>`_.flatMapDeep(collection, [iteratee=_.identity])`
2622 <a href="#_flatmapdeepcollection-iteratee_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L8430 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.flatmapdeep "See the npm package")
2623
2624 This method is like `_.flatMap` except that it recursively flattens the
2625 mapped results.
2626
2627 #### Since
2628 4.7.0
2629 #### Arguments
2630 1. `collection` *(Array|Object)*: The collection to iterate over.
2631 2. `[iteratee=_.identity]` *(Array|Function|Object|string)*: The function invoked per iteration.
2632
2633 #### Returns
2634 *(Array)*: Returns the new flattened array.
2635
2636 #### Example
2637 ```js
2638 function duplicate(n) {
2639   return [[[n, n]]];
2640 }
2641
2642 _.flatMapDeep([1, 2], duplicate);
2643 // => [1, 1, 2, 2]
2644 ```
2645 * * *
2646
2647 <!-- /div -->
2648
2649 <!-- div -->
2650
2651 ### <a id="_flatmapdepthcollection-iteratee_identity-depth1"></a>`_.flatMapDepth(collection, [iteratee=_.identity], [depth=1])`
2652 <a href="#_flatmapdepthcollection-iteratee_identity-depth1">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L8456 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.flatmapdepth "See the npm package")
2653
2654 This method is like `_.flatMap` except that it recursively flattens the
2655 mapped results up to `depth` times.
2656
2657 #### Since
2658 4.7.0
2659 #### Arguments
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.
2663
2664 #### Returns
2665 *(Array)*: Returns the new flattened array.
2666
2667 #### Example
2668 ```js
2669 function duplicate(n) {
2670   return [[[n, n]]];
2671 }
2672
2673 _.flatMapDepth([1, 2], duplicate, 2);
2674 // => [[1, 1], [2, 2]]
2675 ```
2676 * * *
2677
2678 <!-- /div -->
2679
2680 <!-- div -->
2681
2682 ### <a id="_foreachcollection-iteratee_identity"></a>`_.forEach(collection, [iteratee=_.identity])`
2683 <a href="#_foreachcollection-iteratee_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L8491 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.foreach "See the npm package")
2684
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`.
2688 <br>
2689 <br>
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.
2693
2694 #### Since
2695 0.1.0
2696 #### Aliases
2697 *_.each*
2698
2699 #### Arguments
2700 1. `collection` *(Array|Object)*: The collection to iterate over.
2701 2. `[iteratee=_.identity]` *(Function)*: The function invoked per iteration.
2702
2703 #### Returns
2704 *(&#42;)*: Returns `collection`.
2705
2706 #### Example
2707 ```js
2708 _([1, 2]).forEach(function(value) {
2709   console.log(value);
2710 });
2711 // => Logs `1` then `2`.
2712
2713 _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {
2714   console.log(key);
2715 });
2716 // => Logs 'a' then 'b' (iteration order is not guaranteed).
2717 ```
2718 * * *
2719
2720 <!-- /div -->
2721
2722 <!-- div -->
2723
2724 ### <a id="_foreachrightcollection-iteratee_identity"></a>`_.forEachRight(collection, [iteratee=_.identity])`
2725 <a href="#_foreachrightcollection-iteratee_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L8517 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.foreachright "See the npm package")
2726
2727 This method is like `_.forEach` except that it iterates over elements of
2728 `collection` from right to left.
2729
2730 #### Since
2731 2.0.0
2732 #### Aliases
2733 *_.eachRight*
2734
2735 #### Arguments
2736 1. `collection` *(Array|Object)*: The collection to iterate over.
2737 2. `[iteratee=_.identity]` *(Function)*: The function invoked per iteration.
2738
2739 #### Returns
2740 *(&#42;)*: Returns `collection`.
2741
2742 #### Example
2743 ```js
2744 _.forEachRight([1, 2], function(value) {
2745   console.log(value);
2746 });
2747 // => Logs `2` then `1`.
2748 ```
2749 * * *
2750
2751 <!-- /div -->
2752
2753 <!-- div -->
2754
2755 ### <a id="_groupbycollection-iteratee_identity"></a>`_.groupBy(collection, [iteratee=_.identity])`
2756 <a href="#_groupbycollection-iteratee_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L8547 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.groupby "See the npm package")
2757
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)*.
2763
2764 #### Since
2765 0.1.0
2766 #### Arguments
2767 1. `collection` *(Array|Object)*: The collection to iterate over.
2768 2. `[iteratee=_.identity]` *(Array|Function|Object|string)*: The iteratee to transform keys.
2769
2770 #### Returns
2771 *(Object)*: Returns the composed aggregate object.
2772
2773 #### Example
2774 ```js
2775 _.groupBy([6.1, 4.2, 6.3], Math.floor);
2776 // => { '4': [4.2], '6': [6.1, 6.3] }
2777
2778 // The `_.property` iteratee shorthand.
2779 _.groupBy(['one', 'two', 'three'], 'length');
2780 // => { '3': ['one', 'two'], '5': ['three'] }
2781 ```
2782 * * *
2783
2784 <!-- /div -->
2785
2786 <!-- div -->
2787
2788 ### <a id="_includescollection-value-fromindex0"></a>`_.includes(collection, value, [fromIndex=0])`
2789 <a href="#_includescollection-value-fromindex0">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L8585 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.includes "See the npm package")
2790
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`.
2796
2797 #### Since
2798 0.1.0
2799 #### Arguments
2800 1. `collection` *(Array|Object|string)*: The collection to search.
2801 2. `value` *(&#42;)*: The value to search for.
2802 3. `[fromIndex=0]` *(number)*: The index to search from.
2803
2804 #### Returns
2805 *(boolean)*: Returns `true` if `value` is found, else `false`.
2806
2807 #### Example
2808 ```js
2809 _.includes([1, 2, 3], 1);
2810 // => true
2811
2812 _.includes([1, 2, 3], 1, 2);
2813 // => false
2814
2815 _.includes({ 'user': 'fred', 'age': 40 }, 'fred');
2816 // => true
2817
2818 _.includes('pebbles', 'eb');
2819 // => true
2820 ```
2821 * * *
2822
2823 <!-- /div -->
2824
2825 <!-- div -->
2826
2827 ### <a id="_invokemapcollection-path-args"></a>`_.invokeMap(collection, path, [args])`
2828 <a href="#_invokemapcollection-path-args">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L8621 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.invokemap "See the npm package")
2829
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`.
2834
2835 #### Since
2836 4.0.0
2837 #### Arguments
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]` *(...&#42;)*: The arguments to invoke each method with.
2841
2842 #### Returns
2843 *(Array)*: Returns the array of results.
2844
2845 #### Example
2846 ```js
2847 _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort');
2848 // => [[1, 5, 7], [1, 2, 3]]
2849
2850 _.invokeMap([123, 456], String.prototype.split, '');
2851 // => [['1', '2', '3'], ['4', '5', '6']]
2852 ```
2853 * * *
2854
2855 <!-- /div -->
2856
2857 <!-- div -->
2858
2859 ### <a id="_keybycollection-iteratee_identity"></a>`_.keyBy(collection, [iteratee=_.identity])`
2860 <a href="#_keybycollection-iteratee_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L8663 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.keyby "See the npm package")
2861
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)*.
2866
2867 #### Since
2868 4.0.0
2869 #### Arguments
2870 1. `collection` *(Array|Object)*: The collection to iterate over.
2871 2. `[iteratee=_.identity]` *(Array|Function|Object|string)*: The iteratee to transform keys.
2872
2873 #### Returns
2874 *(Object)*: Returns the composed aggregate object.
2875
2876 #### Example
2877 ```js
2878 var array = [
2879   { 'dir': 'left', 'code': 97 },
2880   { 'dir': 'right', 'code': 100 }
2881 ];
2882
2883 _.keyBy(array, function(o) {
2884   return String.fromCharCode(o.code);
2885 });
2886 // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
2887
2888 _.keyBy(array, 'dir');
2889 // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }
2890 ```
2891 * * *
2892
2893 <!-- /div -->
2894
2895 <!-- div -->
2896
2897 ### <a id="_mapcollection-iteratee_identity"></a>`_.map(collection, [iteratee=_.identity])`
2898 <a href="#_mapcollection-iteratee_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L8710 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.map "See the npm package")
2899
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)*.
2903 <br>
2904 <br>
2905 Many lodash methods are guarded to work as iteratees for methods like
2906 `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
2907 <br>
2908 <br>
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`
2914
2915 #### Since
2916 0.1.0
2917 #### Arguments
2918 1. `collection` *(Array|Object)*: The collection to iterate over.
2919 2. `[iteratee=_.identity]` *(Array|Function|Object|string)*: The function invoked per iteration.
2920
2921 #### Returns
2922 *(Array)*: Returns the new mapped array.
2923
2924 #### Example
2925 ```js
2926 function square(n) {
2927   return n * n;
2928 }
2929
2930 _.map([4, 8], square);
2931 // => [16, 64]
2932
2933 _.map({ 'a': 4, 'b': 8 }, square);
2934 // => [16, 64] (iteration order is not guaranteed)
2935
2936 var users = [
2937   { 'user': 'barney' },
2938   { 'user': 'fred' }
2939 ];
2940
2941 // The `_.property` iteratee shorthand.
2942 _.map(users, 'user');
2943 // => ['barney', 'fred']
2944 ```
2945 * * *
2946
2947 <!-- /div -->
2948
2949 <!-- div -->
2950
2951 ### <a id="_orderbycollection-iteratees_identity-orders"></a>`_.orderBy(collection, [iteratees=[_.identity]], [orders])`
2952 <a href="#_orderbycollection-iteratees_identity-orders">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L8744 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.orderby "See the npm package")
2953
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.
2958
2959 #### Since
2960 4.0.0
2961 #### Arguments
2962 1. `collection` *(Array|Object)*: The collection to iterate over.
2963 2. `[iteratees=[_.identity]]` *(Array&#91;&#93;|Function&#91;&#93;|Object&#91;&#93;|string&#91;&#93;)*: The iteratees to sort by.
2964 3. `[orders]` *(string&#91;&#93;)*: The sort orders of `iteratees`.
2965
2966 #### Returns
2967 *(Array)*: Returns the new sorted array.
2968
2969 #### Example
2970 ```js
2971 var users = [
2972   { 'user': 'fred',   'age': 48 },
2973   { 'user': 'barney', 'age': 34 },
2974   { 'user': 'fred',   'age': 40 },
2975   { 'user': 'barney', 'age': 36 }
2976 ];
2977
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]]
2981 ```
2982 * * *
2983
2984 <!-- /div -->
2985
2986 <!-- div -->
2987
2988 ### <a id="_partitioncollection-predicate_identity"></a>`_.partition(collection, [predicate=_.identity])`
2989 <a href="#_partitioncollection-predicate_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L8795 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.partition "See the npm package")
2990
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)*.
2995
2996 #### Since
2997 3.0.0
2998 #### Arguments
2999 1. `collection` *(Array|Object)*: The collection to iterate over.
3000 2. `[predicate=_.identity]` *(Array|Function|Object|string)*: The function invoked per iteration.
3001
3002 #### Returns
3003 *(Array)*: Returns the array of grouped elements.
3004
3005 #### Example
3006 ```js
3007 var users = [
3008   { 'user': 'barney',  'age': 36, 'active': false },
3009   { 'user': 'fred',    'age': 40, 'active': true },
3010   { 'user': 'pebbles', 'age': 1,  'active': false }
3011 ];
3012
3013 _.partition(users, function(o) { return o.active; });
3014 // => objects for [['fred'], ['barney', 'pebbles']]
3015
3016 // The `_.matches` iteratee shorthand.
3017 _.partition(users, { 'age': 1, 'active': false });
3018 // => objects for [['pebbles'], ['barney', 'fred']]
3019
3020 // The `_.matchesProperty` iteratee shorthand.
3021 _.partition(users, ['active', false]);
3022 // => objects for [['barney', 'pebbles'], ['fred']]
3023
3024 // The `_.property` iteratee shorthand.
3025 _.partition(users, 'active');
3026 // => objects for [['fred'], ['barney', 'pebbles']]
3027 ```
3028 * * *
3029
3030 <!-- /div -->
3031
3032 <!-- div -->
3033
3034 ### <a id="_reducecollection-iteratee_identity-accumulator"></a>`_.reduce(collection, [iteratee=_.identity], [accumulator])`
3035 <a href="#_reducecollection-iteratee_identity-accumulator">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L8836 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.reduce "See the npm package")
3036
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)*.
3043 <br>
3044 <br>
3045 Many lodash methods are guarded to work as iteratees for methods like
3046 `_.reduce`, `_.reduceRight`, and `_.transform`.
3047 <br>
3048 <br>
3049 The guarded methods are:<br>
3050 `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,
3051 and `sortBy`
3052
3053 #### Since
3054 0.1.0
3055 #### Arguments
3056 1. `collection` *(Array|Object)*: The collection to iterate over.
3057 2. `[iteratee=_.identity]` *(Function)*: The function invoked per iteration.
3058 3. `[accumulator]` *(&#42;)*: The initial value.
3059
3060 #### Returns
3061 *(&#42;)*: Returns the accumulated value.
3062
3063 #### Example
3064 ```js
3065 _.reduce([1, 2], function(sum, n) {
3066   return sum + n;
3067 }, 0);
3068 // => 3
3069
3070 _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
3071   (result[value] || (result[value] = [])).push(key);
3072   return result;
3073 }, {});
3074 // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)
3075 ```
3076 * * *
3077
3078 <!-- /div -->
3079
3080 <!-- div -->
3081
3082 ### <a id="_reducerightcollection-iteratee_identity-accumulator"></a>`_.reduceRight(collection, [iteratee=_.identity], [accumulator])`
3083 <a href="#_reducerightcollection-iteratee_identity-accumulator">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L8865 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.reduceright "See the npm package")
3084
3085 This method is like `_.reduce` except that it iterates over elements of
3086 `collection` from right to left.
3087
3088 #### Since
3089 0.1.0
3090 #### Arguments
3091 1. `collection` *(Array|Object)*: The collection to iterate over.
3092 2. `[iteratee=_.identity]` *(Function)*: The function invoked per iteration.
3093 3. `[accumulator]` *(&#42;)*: The initial value.
3094
3095 #### Returns
3096 *(&#42;)*: Returns the accumulated value.
3097
3098 #### Example
3099 ```js
3100 var array = [[0, 1], [2, 3], [4, 5]];
3101
3102 _.reduceRight(array, function(flattened, other) {
3103   return flattened.concat(other);
3104 }, []);
3105 // => [4, 5, 2, 3, 0, 1]
3106 ```
3107 * * *
3108
3109 <!-- /div -->
3110
3111 <!-- div -->
3112
3113 ### <a id="_rejectcollection-predicate_identity"></a>`_.reject(collection, [predicate=_.identity])`
3114 <a href="#_rejectcollection-predicate_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L8907 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.reject "See the npm package")
3115
3116 The opposite of `_.filter`; this method returns the elements of `collection`
3117 that `predicate` does **not** return truthy for.
3118
3119 #### Since
3120 0.1.0
3121 #### Arguments
3122 1. `collection` *(Array|Object)*: The collection to iterate over.
3123 2. `[predicate=_.identity]` *(Array|Function|Object|string)*: The function invoked per iteration.
3124
3125 #### Returns
3126 *(Array)*: Returns the new filtered array.
3127
3128 #### Example
3129 ```js
3130 var users = [
3131   { 'user': 'barney', 'age': 36, 'active': false },
3132   { 'user': 'fred',   'age': 40, 'active': true }
3133 ];
3134
3135 _.reject(users, function(o) { return !o.active; });
3136 // => objects for ['fred']
3137
3138 // The `_.matches` iteratee shorthand.
3139 _.reject(users, { 'age': 40, 'active': true });
3140 // => objects for ['barney']
3141
3142 // The `_.matchesProperty` iteratee shorthand.
3143 _.reject(users, ['active', false]);
3144 // => objects for ['fred']
3145
3146 // The `_.property` iteratee shorthand.
3147 _.reject(users, 'active');
3148 // => objects for ['barney']
3149 ```
3150 * * *
3151
3152 <!-- /div -->
3153
3154 <!-- div -->
3155
3156 ### <a id="_samplecollection"></a>`_.sample(collection)`
3157 <a href="#_samplecollection">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L8929 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.sample "See the npm package")
3158
3159 Gets a random element from `collection`.
3160
3161 #### Since
3162 2.0.0
3163 #### Arguments
3164 1. `collection` *(Array|Object)*: The collection to sample.
3165
3166 #### Returns
3167 *(&#42;)*: Returns the random element.
3168
3169 #### Example
3170 ```js
3171 _.sample([1, 2, 3, 4]);
3172 // => 2
3173 ```
3174 * * *
3175
3176 <!-- /div -->
3177
3178 <!-- div -->
3179
3180 ### <a id="_samplesizecollection-n1"></a>`_.sampleSize(collection, [n=1])`
3181 <a href="#_samplesizecollection-n1">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L8956 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.samplesize "See the npm package")
3182
3183 Gets `n` random elements at unique keys from `collection` up to the
3184 size of `collection`.
3185
3186 #### Since
3187 4.0.0
3188 #### Arguments
3189 1. `collection` *(Array|Object)*: The collection to sample.
3190 2. `[n=1]` *(number)*: The number of elements to sample.
3191
3192 #### Returns
3193 *(Array)*: Returns the random elements.
3194
3195 #### Example
3196 ```js
3197 _.sampleSize([1, 2, 3], 2);
3198 // => [3, 1]
3199
3200 _.sampleSize([1, 2, 3], 4);
3201 // => [2, 3, 1]
3202 ```
3203 * * *
3204
3205 <!-- /div -->
3206
3207 <!-- div -->
3208
3209 ### <a id="_shufflecollection"></a>`_.shuffle(collection)`
3210 <a href="#_shufflecollection">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L8993 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.shuffle "See the npm package")
3211
3212 Creates an array of shuffled values, using a version of the
3213 [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).
3214
3215 #### Since
3216 0.1.0
3217 #### Arguments
3218 1. `collection` *(Array|Object)*: The collection to shuffle.
3219
3220 #### Returns
3221 *(Array)*: Returns the new shuffled array.
3222
3223 #### Example
3224 ```js
3225 _.shuffle([1, 2, 3, 4]);
3226 // => [4, 1, 3, 2]
3227 ```
3228 * * *
3229
3230 <!-- /div -->
3231
3232 <!-- div -->
3233
3234 ### <a id="_sizecollection"></a>`_.size(collection)`
3235 <a href="#_sizecollection">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L9018 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.size "See the npm package")
3236
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.
3239
3240 #### Since
3241 0.1.0
3242 #### Arguments
3243 1. `collection` *(Array|Object)*: The collection to inspect.
3244
3245 #### Returns
3246 *(number)*: Returns the collection size.
3247
3248 #### Example
3249 ```js
3250 _.size([1, 2, 3]);
3251 // => 3
3252
3253 _.size({ 'a': 1, 'b': 2 });
3254 // => 2
3255
3256 _.size('pebbles');
3257 // => 7
3258 ```
3259 * * *
3260
3261 <!-- /div -->
3262
3263 <!-- div -->
3264
3265 ### <a id="_somecollection-predicate_identity"></a>`_.some(collection, [predicate=_.identity])`
3266 <a href="#_somecollection-predicate_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L9072 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.some "See the npm package")
3267
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)*.
3271
3272 #### Since
3273 0.1.0
3274 #### Arguments
3275 1. `collection` *(Array|Object)*: The collection to iterate over.
3276 2. `[predicate=_.identity]` *(Array|Function|Object|string)*: The function invoked per iteration.
3277
3278 #### Returns
3279 *(boolean)*: Returns `true` if any element passes the predicate check, else `false`.
3280
3281 #### Example
3282 ```js
3283 _.some([null, 0, 'yes', false], Boolean);
3284 // => true
3285
3286 var users = [
3287   { 'user': 'barney', 'active': true },
3288   { 'user': 'fred',   'active': false }
3289 ];
3290
3291 // The `_.matches` iteratee shorthand.
3292 _.some(users, { 'user': 'barney', 'active': false });
3293 // => false
3294
3295 // The `_.matchesProperty` iteratee shorthand.
3296 _.some(users, ['active', false]);
3297 // => true
3298
3299 // The `_.property` iteratee shorthand.
3300 _.some(users, 'active');
3301 // => true
3302 ```
3303 * * *
3304
3305 <!-- /div -->
3306
3307 <!-- div -->
3308
3309 ### <a id="_sortbycollection-iteratees_identity"></a>`_.sortBy(collection, [iteratees=[_.identity]])`
3310 <a href="#_sortbycollection-iteratees_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L9114 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.sortby "See the npm package")
3311
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)*.
3316
3317 #### Since
3318 0.1.0
3319 #### Arguments
3320 1. `collection` *(Array|Object)*: The collection to iterate over.
3321 2. `[iteratees=[_.identity]]` *(...(Array|Array&#91;&#93;|Function|Function&#91;&#93;|Object|Object&#91;&#93;|string|string&#91;&#93;))*: The iteratees to sort by.
3322
3323 #### Returns
3324 *(Array)*: Returns the new sorted array.
3325
3326 #### Example
3327 ```js
3328 var users = [
3329   { 'user': 'fred',   'age': 48 },
3330   { 'user': 'barney', 'age': 36 },
3331   { 'user': 'fred',   'age': 40 },
3332   { 'user': 'barney', 'age': 34 }
3333 ];
3334
3335 _.sortBy(users, function(o) { return o.user; });
3336 // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
3337
3338 _.sortBy(users, ['user', 'age']);
3339 // => objects for [['barney', 34], ['barney', 36], ['fred', 40], ['fred', 48]]
3340
3341 _.sortBy(users, 'user', function(o) {
3342   return Math.floor(o.age / 10);
3343 });
3344 // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
3345 ```
3346 * * *
3347
3348 <!-- /div -->
3349
3350 <!-- /div -->
3351
3352 <!-- div -->
3353
3354 ## `“Date” Methods`
3355
3356 <!-- div -->
3357
3358 ### <a id="_now"></a>`_.now()`
3359 <a href="#_now">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L9150 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.now "See the npm package")
3360
3361 Gets the timestamp of the number of milliseconds that have elapsed since
3362 the Unix epoch *(1 January `1970 00`:00:00 UTC)*.
3363
3364 #### Since
3365 2.4.0
3366 #### Returns
3367 *(number)*: Returns the timestamp.
3368
3369 #### Example
3370 ```js
3371 _.defer(function(stamp) {
3372   console.log(_.now() - stamp);
3373 }, _.now());
3374 // => Logs the number of milliseconds it took for the deferred function to be invoked.
3375 ```
3376 * * *
3377
3378 <!-- /div -->
3379
3380 <!-- /div -->
3381
3382 <!-- div -->
3383
3384 ## `“Function” Methods`
3385
3386 <!-- div -->
3387
3388 ### <a id="_aftern-func"></a>`_.after(n, func)`
3389 <a href="#_aftern-func">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L9178 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.after "See the npm package")
3390
3391 The opposite of `_.before`; this method creates a function that invokes
3392 `func` once it's called `n` or more times.
3393
3394 #### Since
3395 0.1.0
3396 #### Arguments
3397 1. `n` *(number)*: The number of calls before `func` is invoked.
3398 2. `func` *(Function)*: The function to restrict.
3399
3400 #### Returns
3401 *(Function)*: Returns the new restricted function.
3402
3403 #### Example
3404 ```js
3405 var saves = ['profile', 'settings'];
3406
3407 var done = _.after(saves.length, function() {
3408   console.log('done saving!');
3409 });
3410
3411 _.forEach(saves, function(type) {
3412   asyncSave({ 'type': type, 'complete': done });
3413 });
3414 // => Logs 'done saving!' after the two async saves have completed.
3415 ```
3416 * * *
3417
3418 <!-- /div -->
3419
3420 <!-- div -->
3421
3422 ### <a id="_aryfunc-nfunclength"></a>`_.ary(func, [n=func.length])`
3423 <a href="#_aryfunc-nfunclength">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L9207 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.ary "See the npm package")
3424
3425 Creates a function that invokes `func`, with up to `n` arguments,
3426 ignoring any additional arguments.
3427
3428 #### Since
3429 3.0.0
3430 #### Arguments
3431 1. `func` *(Function)*: The function to cap arguments for.
3432 2. `[n=func.length]` *(number)*: The arity cap.
3433
3434 #### Returns
3435 *(Function)*: Returns the new function.
3436
3437 #### Example
3438 ```js
3439 _.map(['6', '8', '10'], _.ary(parseInt, 1));
3440 // => [6, 8, 10]
3441 ```
3442 * * *
3443
3444 <!-- /div -->
3445
3446 <!-- div -->
3447
3448 ### <a id="_beforen-func"></a>`_.before(n, func)`
3449 <a href="#_beforen-func">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L9230 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.before "See the npm package")
3450
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.
3454
3455 #### Since
3456 3.0.0
3457 #### Arguments
3458 1. `n` *(number)*: The number of calls at which `func` is no longer invoked.
3459 2. `func` *(Function)*: The function to restrict.
3460
3461 #### Returns
3462 *(Function)*: Returns the new restricted function.
3463
3464 #### Example
3465 ```js
3466 jQuery(element).on('click', _.before(5, addContactToList));
3467 // => allows adding up to 4 contacts to the list
3468 ```
3469 * * *
3470
3471 <!-- /div -->
3472
3473 <!-- div -->
3474
3475 ### <a id="_bindfunc-thisarg-partials"></a>`_.bind(func, thisArg, [partials])`
3476 <a href="#_bindfunc-thisarg-partials">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L9282 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.bind "See the npm package")
3477
3478 Creates a function that invokes `func` with the `this` binding of `thisArg`
3479 and `partials` prepended to the arguments it receives.
3480 <br>
3481 <br>
3482 The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,
3483 may be used as a placeholder for partially applied arguments.
3484 <br>
3485 <br>
3486 **Note:** Unlike native `Function#bind` this method doesn't set the "length"
3487 property of bound functions.
3488
3489 #### Since
3490 0.1.0
3491 #### Arguments
3492 1. `func` *(Function)*: The function to bind.
3493 2. `thisArg` *(&#42;)*: The `this` binding of `func`.
3494 3. `[partials]` *(...&#42;)*: The arguments to be partially applied.
3495
3496 #### Returns
3497 *(Function)*: Returns the new bound function.
3498
3499 #### Example
3500 ```js
3501 var greet = function(greeting, punctuation) {
3502   return greeting + ' ' + this.user + punctuation;
3503 };
3504
3505 var object = { 'user': 'fred' };
3506
3507 var bound = _.bind(greet, object, 'hi');
3508 bound('!');
3509 // => 'hi fred!'
3510
3511 // Bound with placeholders.
3512 var bound = _.bind(greet, object, _, '!');
3513 bound('hi');
3514 // => 'hi fred!'
3515 ```
3516 * * *
3517
3518 <!-- /div -->
3519
3520 <!-- div -->
3521
3522 ### <a id="_bindkeyobject-key-partials"></a>`_.bindKey(object, key, [partials])`
3523 <a href="#_bindkeyobject-key-partials">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L9336 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.bindkey "See the npm package")
3524
3525 Creates a function that invokes the method at `object[key]` with `partials`
3526 prepended to the arguments it receives.
3527 <br>
3528 <br>
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)
3532 for more details.
3533 <br>
3534 <br>
3535 The `_.bindKey.placeholder` value, which defaults to `_` in monolithic
3536 builds, may be used as a placeholder for partially applied arguments.
3537
3538 #### Since
3539 0.10.0
3540 #### Arguments
3541 1. `object` *(Object)*: The object to invoke the method on.
3542 2. `key` *(string)*: The key of the method.
3543 3. `[partials]` *(...&#42;)*: The arguments to be partially applied.
3544
3545 #### Returns
3546 *(Function)*: Returns the new bound function.
3547
3548 #### Example
3549 ```js
3550 var object = {
3551   'user': 'fred',
3552   'greet': function(greeting, punctuation) {
3553     return greeting + ' ' + this.user + punctuation;
3554   }
3555 };
3556
3557 var bound = _.bindKey(object, 'greet', 'hi');
3558 bound('!');
3559 // => 'hi fred!'
3560
3561 object.greet = function(greeting, punctuation) {
3562   return greeting + 'ya ' + this.user + punctuation;
3563 };
3564
3565 bound('!');
3566 // => 'hiya fred!'
3567
3568 // Bound with placeholders.
3569 var bound = _.bindKey(object, 'greet', _, '!');
3570 bound('hi');
3571 // => 'hiya fred!'
3572 ```
3573 * * *
3574
3575 <!-- /div -->
3576
3577 <!-- div -->
3578
3579 ### <a id="_curryfunc-arityfunclength"></a>`_.curry(func, [arity=func.length])`
3580 <a href="#_curryfunc-arityfunclength">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L9386 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.curry "See the npm package")
3581
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`
3586 is not sufficient.
3587 <br>
3588 <br>
3589 The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,
3590 may be used as a placeholder for provided arguments.
3591 <br>
3592 <br>
3593 **Note:** This method doesn't set the "length" property of curried functions.
3594
3595 #### Since
3596 2.0.0
3597 #### Arguments
3598 1. `func` *(Function)*: The function to curry.
3599 2. `[arity=func.length]` *(number)*: The arity of `func`.
3600
3601 #### Returns
3602 *(Function)*: Returns the new curried function.
3603
3604 #### Example
3605 ```js
3606 var abc = function(a, b, c) {
3607   return [a, b, c];
3608 };
3609
3610 var curried = _.curry(abc);
3611
3612 curried(1)(2)(3);
3613 // => [1, 2, 3]
3614
3615 curried(1, 2)(3);
3616 // => [1, 2, 3]
3617
3618 curried(1, 2, 3);
3619 // => [1, 2, 3]
3620
3621 // Curried with placeholders.
3622 curried(1)(_, 3)(2);
3623 // => [1, 2, 3]
3624 ```
3625 * * *
3626
3627 <!-- /div -->
3628
3629 <!-- div -->
3630
3631 ### <a id="_curryrightfunc-arityfunclength"></a>`_.curryRight(func, [arity=func.length])`
3632 <a href="#_curryrightfunc-arityfunclength">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L9431 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.curryright "See the npm package")
3633
3634 This method is like `_.curry` except that arguments are applied to `func`
3635 in the manner of `_.partialRight` instead of `_.partial`.
3636 <br>
3637 <br>
3638 The `_.curryRight.placeholder` value, which defaults to `_` in monolithic
3639 builds, may be used as a placeholder for provided arguments.
3640 <br>
3641 <br>
3642 **Note:** This method doesn't set the "length" property of curried functions.
3643
3644 #### Since
3645 3.0.0
3646 #### Arguments
3647 1. `func` *(Function)*: The function to curry.
3648 2. `[arity=func.length]` *(number)*: The arity of `func`.
3649
3650 #### Returns
3651 *(Function)*: Returns the new curried function.
3652
3653 #### Example
3654 ```js
3655 var abc = function(a, b, c) {
3656   return [a, b, c];
3657 };
3658
3659 var curried = _.curryRight(abc);
3660
3661 curried(3)(2)(1);
3662 // => [1, 2, 3]
3663
3664 curried(2, 3)(1);
3665 // => [1, 2, 3]
3666
3667 curried(1, 2, 3);
3668 // => [1, 2, 3]
3669
3670 // Curried with placeholders.
3671 curried(3)(1, _)(2);
3672 // => [1, 2, 3]
3673 ```
3674 * * *
3675
3676 <!-- /div -->
3677
3678 <!-- div -->
3679
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> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L9488 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.debounce "See the npm package")
3682
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.
3691 <br>
3692 <br>
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.
3696 <br>
3697 <br>
3698 See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
3699 for details over the differences between `_.debounce` and `_.throttle`.
3700
3701 #### Since
3702 0.1.0
3703 #### Arguments
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.
3710
3711 #### Returns
3712 *(Function)*: Returns the new debounced function.
3713
3714 #### Example
3715 ```js
3716 // Avoid costly calculations while the window size is in flux.
3717 jQuery(window).on('resize', _.debounce(calculateLayout, 150));
3718
3719 // Invoke `sendMail` when clicked, debouncing subsequent calls.
3720 jQuery(element).on('click', _.debounce(sendMail, 300, {
3721   'leading': true,
3722   'trailing': false
3723 }));
3724
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);
3729
3730 // Cancel the trailing debounced invocation.
3731 jQuery(window).on('popstate', debounced.cancel);
3732 ```
3733 * * *
3734
3735 <!-- /div -->
3736
3737 <!-- div -->
3738
3739 ### <a id="_deferfunc-args"></a>`_.defer(func, [args])`
3740 <a href="#_deferfunc-args">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L9630 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.defer "See the npm package")
3741
3742 Defers invoking the `func` until the current call stack has cleared. Any
3743 additional arguments are provided to `func` when it's invoked.
3744
3745 #### Since
3746 0.1.0
3747 #### Arguments
3748 1. `func` *(Function)*: The function to defer.
3749 2. `[args]` *(...&#42;)*: The arguments to invoke `func` with.
3750
3751 #### Returns
3752 *(number)*: Returns the timer id.
3753
3754 #### Example
3755 ```js
3756 _.defer(function(text) {
3757   console.log(text);
3758 }, 'deferred');
3759 // => Logs 'deferred' after one or more milliseconds.
3760 ```
3761 * * *
3762
3763 <!-- /div -->
3764
3765 <!-- div -->
3766
3767 ### <a id="_delayfunc-wait-args"></a>`_.delay(func, wait, [args])`
3768 <a href="#_delayfunc-wait-args">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L9653 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.delay "See the npm package")
3769
3770 Invokes `func` after `wait` milliseconds. Any additional arguments are
3771 provided to `func` when it's invoked.
3772
3773 #### Since
3774 0.1.0
3775 #### Arguments
3776 1. `func` *(Function)*: The function to delay.
3777 2. `wait` *(number)*: The number of milliseconds to delay invocation.
3778 3. `[args]` *(...&#42;)*: The arguments to invoke `func` with.
3779
3780 #### Returns
3781 *(number)*: Returns the timer id.
3782
3783 #### Example
3784 ```js
3785 _.delay(function(text) {
3786   console.log(text);
3787 }, 1000, 'later');
3788 // => Logs 'later' after one second.
3789 ```
3790 * * *
3791
3792 <!-- /div -->
3793
3794 <!-- div -->
3795
3796 ### <a id="_flipfunc"></a>`_.flip(func)`
3797 <a href="#_flipfunc">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L9675 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.flip "See the npm package")
3798
3799 Creates a function that invokes `func` with arguments reversed.
3800
3801 #### Since
3802 4.0.0
3803 #### Arguments
3804 1. `func` *(Function)*: The function to flip arguments for.
3805
3806 #### Returns
3807 *(Function)*: Returns the new function.
3808
3809 #### Example
3810 ```js
3811 var flipped = _.flip(function() {
3812   return _.toArray(arguments);
3813 });
3814
3815 flipped('a', 'b', 'c', 'd');
3816 // => ['d', 'c', 'b', 'a']
3817 ```
3818 * * *
3819
3820 <!-- /div -->
3821
3822 <!-- div -->
3823
3824 ### <a id="_memoizefunc-resolver"></a>`_.memoize(func, [resolver])`
3825 <a href="#_memoizefunc-resolver">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L9723 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.memoize "See the npm package")
3826
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.
3832 <br>
3833 <br>
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`.
3839
3840 #### Since
3841 0.1.0
3842 #### Arguments
3843 1. `func` *(Function)*: The function to have its output memoized.
3844 2. `[resolver]` *(Function)*: The function to resolve the cache key.
3845
3846 #### Returns
3847 *(Function)*: Returns the new memoizing function.
3848
3849 #### Example
3850 ```js
3851 var object = { 'a': 1, 'b': 2 };
3852 var other = { 'c': 3, 'd': 4 };
3853
3854 var values = _.memoize(_.values);
3855 values(object);
3856 // => [1, 2]
3857
3858 values(other);
3859 // => [3, 4]
3860
3861 object.a = 2;
3862 values(object);
3863 // => [1, 2]
3864
3865 // Modify the result cache.
3866 values.cache.set(object, ['a', 'b']);
3867 values(object);
3868 // => ['a', 'b']
3869
3870 // Replace `_.memoize.Cache`.
3871 _.memoize.Cache = WeakMap;
3872 ```
3873 * * *
3874
3875 <!-- /div -->
3876
3877 <!-- div -->
3878
3879 ### <a id="_negatepredicate"></a>`_.negate(predicate)`
3880 <a href="#_negatepredicate">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L9766 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.negate "See the npm package")
3881
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
3884 created function.
3885
3886 #### Since
3887 3.0.0
3888 #### Arguments
3889 1. `predicate` *(Function)*: The predicate to negate.
3890
3891 #### Returns
3892 *(Function)*: Returns the new function.
3893
3894 #### Example
3895 ```js
3896 function isEven(n) {
3897   return n % 2 == 0;
3898 }
3899
3900 _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));
3901 // => [1, 3, 5]
3902 ```
3903 * * *
3904
3905 <!-- /div -->
3906
3907 <!-- div -->
3908
3909 ### <a id="_oncefunc"></a>`_.once(func)`
3910 <a href="#_oncefunc">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L9793 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.once "See the npm package")
3911
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.
3915
3916 #### Since
3917 0.1.0
3918 #### Arguments
3919 1. `func` *(Function)*: The function to restrict.
3920
3921 #### Returns
3922 *(Function)*: Returns the new restricted function.
3923
3924 #### Example
3925 ```js
3926 var initialize = _.once(createApplication);
3927 initialize();
3928 initialize();
3929 // `initialize` invokes `createApplication` once
3930 ```
3931 * * *
3932
3933 <!-- /div -->
3934
3935 <!-- div -->
3936
3937 ### <a id="_overargsfunc"></a>`_.overArgs(func)`
3938 <a href="#_overargsfunc">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L9829 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.overargs "See the npm package")
3939
3940 Creates a function that invokes `func` with arguments transformed by
3941 corresponding `transforms`.
3942
3943 #### Since
3944 4.0.0
3945 #### Arguments
3946 1. `func` *(Function)*: The function to wrap.
3947
3948 #### Returns
3949 *(Function)*: Returns the new function.
3950
3951 #### Example
3952 ```js
3953 function doubled(n) {
3954   return n * 2;
3955 }
3956
3957 function square(n) {
3958   return n * n;
3959 }
3960
3961 var func = _.overArgs(function(x, y) {
3962   return [x, y];
3963 }, square, doubled);
3964
3965 func(9, 3);
3966 // => [81, 6]
3967
3968 func(10, 5);
3969 // => [100, 10]
3970 ```
3971 * * *
3972
3973 <!-- /div -->
3974
3975 <!-- div -->
3976
3977 ### <a id="_partialfunc-partials"></a>`_.partial(func, [partials])`
3978 <a href="#_partialfunc-partials">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L9879 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.partial "See the npm package")
3979
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.
3983 <br>
3984 <br>
3985 The `_.partial.placeholder` value, which defaults to `_` in monolithic
3986 builds, may be used as a placeholder for partially applied arguments.
3987 <br>
3988 <br>
3989 **Note:** This method doesn't set the "length" property of partially
3990 applied functions.
3991
3992 #### Since
3993 0.2.0
3994 #### Arguments
3995 1. `func` *(Function)*: The function to partially apply arguments to.
3996 2. `[partials]` *(...&#42;)*: The arguments to be partially applied.
3997
3998 #### Returns
3999 *(Function)*: Returns the new partially applied function.
4000
4001 #### Example
4002 ```js
4003 var greet = function(greeting, name) {
4004   return greeting + ' ' + name;
4005 };
4006
4007 var sayHelloTo = _.partial(greet, 'hello');
4008 sayHelloTo('fred');
4009 // => 'hello fred'
4010
4011 // Partially applied with placeholders.
4012 var greetFred = _.partial(greet, _, 'fred');
4013 greetFred('hi');
4014 // => 'hi fred'
4015 ```
4016 * * *
4017
4018 <!-- /div -->
4019
4020 <!-- div -->
4021
4022 ### <a id="_partialrightfunc-partials"></a>`_.partialRight(func, [partials])`
4023 <a href="#_partialrightfunc-partials">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L9916 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.partialright "See the npm package")
4024
4025 This method is like `_.partial` except that partially applied arguments
4026 are appended to the arguments it receives.
4027 <br>
4028 <br>
4029 The `_.partialRight.placeholder` value, which defaults to `_` in monolithic
4030 builds, may be used as a placeholder for partially applied arguments.
4031 <br>
4032 <br>
4033 **Note:** This method doesn't set the "length" property of partially
4034 applied functions.
4035
4036 #### Since
4037 1.0.0
4038 #### Arguments
4039 1. `func` *(Function)*: The function to partially apply arguments to.
4040 2. `[partials]` *(...&#42;)*: The arguments to be partially applied.
4041
4042 #### Returns
4043 *(Function)*: Returns the new partially applied function.
4044
4045 #### Example
4046 ```js
4047 var greet = function(greeting, name) {
4048   return greeting + ' ' + name;
4049 };
4050
4051 var greetFred = _.partialRight(greet, 'fred');
4052 greetFred('hi');
4053 // => 'hi fred'
4054
4055 // Partially applied with placeholders.
4056 var sayHelloTo = _.partialRight(greet, 'hello', _);
4057 sayHelloTo('fred');
4058 // => 'hello fred'
4059 ```
4060 * * *
4061
4062 <!-- /div -->
4063
4064 <!-- div -->
4065
4066 ### <a id="_reargfunc-indexes"></a>`_.rearg(func, indexes)`
4067 <a href="#_reargfunc-indexes">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L9943 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.rearg "See the npm package")
4068
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.
4073
4074 #### Since
4075 3.0.0
4076 #### Arguments
4077 1. `func` *(Function)*: The function to rearrange arguments for.
4078 2. `indexes` *(...(number|number&#91;&#93;))*: The arranged argument indexes.
4079
4080 #### Returns
4081 *(Function)*: Returns the new function.
4082
4083 #### Example
4084 ```js
4085 var rearged = _.rearg(function(a, b, c) {
4086   return [a, b, c];
4087 }, 2, 0, 1);
4088
4089 rearged('b', 'c', 'a')
4090 // => ['a', 'b', 'c']
4091 ```
4092 * * *
4093
4094 <!-- /div -->
4095
4096 <!-- div -->
4097
4098 ### <a id="_restfunc-startfunclength-1"></a>`_.rest(func, [start=func.length-1])`
4099 <a href="#_restfunc-startfunclength-1">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L9972 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.rest "See the npm package")
4100
4101 Creates a function that invokes `func` with the `this` binding of the
4102 created function and arguments from `start` and beyond provided as
4103 an array.
4104 <br>
4105 <br>
4106 **Note:** This method is based on the
4107 [rest parameter](https://mdn.io/rest_parameters).
4108
4109 #### Since
4110 4.0.0
4111 #### Arguments
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.
4114
4115 #### Returns
4116 *(Function)*: Returns the new function.
4117
4118 #### Example
4119 ```js
4120 var say = _.rest(function(what, names) {
4121   return what + ' ' + _.initial(names).join(', ') +
4122     (_.size(names) > 1 ? ', & ' : '') + _.last(names);
4123 });
4124
4125 say('hello', 'fred', 'barney', 'pebbles');
4126 // => 'hello fred, barney, & pebbles'
4127 ```
4128 * * *
4129
4130 <!-- /div -->
4131
4132 <!-- div -->
4133
4134 ### <a id="_spreadfunc-start0"></a>`_.spread(func, [start=0])`
4135 <a href="#_spreadfunc-start0">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10035 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.spread "See the npm package")
4136
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).
4140 <br>
4141 <br>
4142 **Note:** This method is based on the
4143 [spread operator](https://mdn.io/spread_operator).
4144
4145 #### Since
4146 3.2.0
4147 #### Arguments
4148 1. `func` *(Function)*: The function to spread arguments over.
4149 2. `[start=0]` *(number)*: The start position of the spread.
4150
4151 #### Returns
4152 *(Function)*: Returns the new function.
4153
4154 #### Example
4155 ```js
4156 var say = _.spread(function(who, what) {
4157   return who + ' says ' + what;
4158 });
4159
4160 say(['fred', 'hello']);
4161 // => 'fred says hello'
4162
4163 var numbers = Promise.all([
4164   Promise.resolve(40),
4165   Promise.resolve(36)
4166 ]);
4167
4168 numbers.then(_.spread(function(x, y) {
4169   return x + y;
4170 }));
4171 // => a Promise of 76
4172 ```
4173 * * *
4174
4175 <!-- /div -->
4176
4177 <!-- div -->
4178
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> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10092 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.throttle "See the npm package")
4181
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.
4190 <br>
4191 <br>
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.
4195 <br>
4196 <br>
4197 See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
4198 for details over the differences between `_.throttle` and `_.debounce`.
4199
4200 #### Since
4201 0.1.0
4202 #### Arguments
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.
4208
4209 #### Returns
4210 *(Function)*: Returns the new throttled function.
4211
4212 #### Example
4213 ```js
4214 // Avoid excessively updating the position while scrolling.
4215 jQuery(window).on('scroll', _.throttle(updatePosition, 100));
4216
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);
4220
4221 // Cancel the trailing throttled invocation.
4222 jQuery(window).on('popstate', throttled.cancel);
4223 ```
4224 * * *
4225
4226 <!-- /div -->
4227
4228 <!-- div -->
4229
4230 ### <a id="_unaryfunc"></a>`_.unary(func)`
4231 <a href="#_unaryfunc">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10125 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.unary "See the npm package")
4232
4233 Creates a function that accepts up to one argument, ignoring any
4234 additional arguments.
4235
4236 #### Since
4237 4.0.0
4238 #### Arguments
4239 1. `func` *(Function)*: The function to cap arguments for.
4240
4241 #### Returns
4242 *(Function)*: Returns the new function.
4243
4244 #### Example
4245 ```js
4246 _.map(['6', '8', '10'], _.unary(parseInt));
4247 // => [6, 8, 10]
4248 ```
4249 * * *
4250
4251 <!-- /div -->
4252
4253 <!-- div -->
4254
4255 ### <a id="_wrapvalue-wrapperidentity"></a>`_.wrap(value, [wrapper=identity])`
4256 <a href="#_wrapvalue-wrapperidentity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10151 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.wrap "See the npm package")
4257
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.
4262
4263 #### Since
4264 0.1.0
4265 #### Arguments
4266 1. `value` *(&#42;)*: The value to wrap.
4267 2. `[wrapper=identity]` *(Function)*: The wrapper function.
4268
4269 #### Returns
4270 *(Function)*: Returns the new function.
4271
4272 #### Example
4273 ```js
4274 var p = _.wrap(_.escape, function(func, text) {
4275   return '<p>' + func(text) + '</p>';
4276 });
4277
4278 p('fred, barney, & pebbles');
4279 // => '<p>fred, barney, &amp; pebbles</p>'
4280 ```
4281 * * *
4282
4283 <!-- /div -->
4284
4285 <!-- /div -->
4286
4287 <!-- div -->
4288
4289 ## `“Lang” Methods`
4290
4291 <!-- div -->
4292
4293 ### <a id="_castarrayvalue"></a>`_.castArray(value)`
4294 <a href="#_castarrayvalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10191 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.castarray "See the npm package")
4295
4296 Casts `value` as an array if it's not one.
4297
4298 #### Since
4299 4.4.0
4300 #### Arguments
4301 1. `value` *(&#42;)*: The value to inspect.
4302
4303 #### Returns
4304 *(Array)*: Returns the cast array.
4305
4306 #### Example
4307 ```js
4308 _.castArray(1);
4309 // => [1]
4310
4311 _.castArray({ 'a': 1 });
4312 // => [{ 'a': 1 }]
4313
4314 _.castArray('abc');
4315 // => ['abc']
4316
4317 _.castArray(null);
4318 // => [null]
4319
4320 _.castArray(undefined);
4321 // => [undefined]
4322
4323 _.castArray();
4324 // => []
4325
4326 var array = [1, 2, 3];
4327 console.log(_.castArray(array) === array);
4328 // => true
4329 ```
4330 * * *
4331
4332 <!-- /div -->
4333
4334 <!-- div -->
4335
4336 ### <a id="_clonevalue"></a>`_.clone(value)`
4337 <a href="#_clonevalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10225 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.clone "See the npm package")
4338
4339 Creates a shallow clone of `value`.
4340 <br>
4341 <br>
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.
4349
4350 #### Since
4351 0.1.0
4352 #### Arguments
4353 1. `value` *(&#42;)*: The value to clone.
4354
4355 #### Returns
4356 *(&#42;)*: Returns the cloned value.
4357
4358 #### Example
4359 ```js
4360 var objects = [{ 'a': 1 }, { 'b': 2 }];
4361
4362 var shallow = _.clone(objects);
4363 console.log(shallow[0] === objects[0]);
4364 // => true
4365 ```
4366 * * *
4367
4368 <!-- /div -->
4369
4370 <!-- div -->
4371
4372 ### <a id="_clonedeepvalue"></a>`_.cloneDeep(value)`
4373 <a href="#_clonedeepvalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10282 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.clonedeep "See the npm package")
4374
4375 This method is like `_.clone` except that it recursively clones `value`.
4376
4377 #### Since
4378 1.0.0
4379 #### Arguments
4380 1. `value` *(&#42;)*: The value to recursively clone.
4381
4382 #### Returns
4383 *(&#42;)*: Returns the deep cloned value.
4384
4385 #### Example
4386 ```js
4387 var objects = [{ 'a': 1 }, { 'b': 2 }];
4388
4389 var deep = _.cloneDeep(objects);
4390 console.log(deep[0] === objects[0]);
4391 // => false
4392 ```
4393 * * *
4394
4395 <!-- /div -->
4396
4397 <!-- div -->
4398
4399 ### <a id="_clonedeepwithvalue-customizer"></a>`_.cloneDeepWith(value, [customizer])`
4400 <a href="#_clonedeepwithvalue-customizer">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10314 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.clonedeepwith "See the npm package")
4401
4402 This method is like `_.cloneWith` except that it recursively clones `value`.
4403
4404 #### Since
4405 4.0.0
4406 #### Arguments
4407 1. `value` *(&#42;)*: The value to recursively clone.
4408 2. `[customizer]` *(Function)*: The function to customize cloning.
4409
4410 #### Returns
4411 *(&#42;)*: Returns the deep cloned value.
4412
4413 #### Example
4414 ```js
4415 function customizer(value) {
4416   if (_.isElement(value)) {
4417     return value.cloneNode(true);
4418   }
4419 }
4420
4421 var el = _.cloneDeepWith(document.body, customizer);
4422
4423 console.log(el === document.body);
4424 // => false
4425 console.log(el.nodeName);
4426 // => 'BODY'
4427 console.log(el.childNodes.length);
4428 // => 20
4429 ```
4430 * * *
4431
4432 <!-- /div -->
4433
4434 <!-- div -->
4435
4436 ### <a id="_clonewithvalue-customizer"></a>`_.cloneWith(value, [customizer])`
4437 <a href="#_clonewithvalue-customizer">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10260 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.clonewith "See the npm package")
4438
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])*.
4443
4444 #### Since
4445 4.0.0
4446 #### Arguments
4447 1. `value` *(&#42;)*: The value to clone.
4448 2. `[customizer]` *(Function)*: The function to customize cloning.
4449
4450 #### Returns
4451 *(&#42;)*: Returns the cloned value.
4452
4453 #### Example
4454 ```js
4455 function customizer(value) {
4456   if (_.isElement(value)) {
4457     return value.cloneNode(false);
4458   }
4459 }
4460
4461 var el = _.cloneWith(document.body, customizer);
4462
4463 console.log(el === document.body);
4464 // => false
4465 console.log(el.nodeName);
4466 // => 'BODY'
4467 console.log(el.childNodes.length);
4468 // => 0
4469 ```
4470 * * *
4471
4472 <!-- /div -->
4473
4474 <!-- div -->
4475
4476 ### <a id="_eqvalue-other"></a>`_.eq(value, other)`
4477 <a href="#_eqvalue-other">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10350 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.eq "See the npm package")
4478
4479 Performs a
4480 [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
4481 comparison between two values to determine if they are equivalent.
4482
4483 #### Since
4484 4.0.0
4485 #### Arguments
4486 1. `value` *(&#42;)*: The value to compare.
4487 2. `other` *(&#42;)*: The other value to compare.
4488
4489 #### Returns
4490 *(boolean)*: Returns `true` if the values are equivalent, else `false`.
4491
4492 #### Example
4493 ```js
4494 var object = { 'user': 'fred' };
4495 var other = { 'user': 'fred' };
4496
4497 _.eq(object, object);
4498 // => true
4499
4500 _.eq(object, other);
4501 // => false
4502
4503 _.eq('a', 'a');
4504 // => true
4505
4506 _.eq('a', Object('a'));
4507 // => false
4508
4509 _.eq(NaN, NaN);
4510 // => true
4511 ```
4512 * * *
4513
4514 <!-- /div -->
4515
4516 <!-- div -->
4517
4518 ### <a id="_gtvalue-other"></a>`_.gt(value, other)`
4519 <a href="#_gtvalue-other">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10377 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.gt "See the npm package")
4520
4521 Checks if `value` is greater than `other`.
4522
4523 #### Since
4524 3.9.0
4525 #### Arguments
4526 1. `value` *(&#42;)*: The value to compare.
4527 2. `other` *(&#42;)*: The other value to compare.
4528
4529 #### Returns
4530 *(boolean)*: Returns `true` if `value` is greater than `other`, else `false`.
4531
4532 #### Example
4533 ```js
4534 _.gt(3, 1);
4535 // => true
4536
4537 _.gt(3, 3);
4538 // => false
4539
4540 _.gt(1, 3);
4541 // => false
4542 ```
4543 * * *
4544
4545 <!-- /div -->
4546
4547 <!-- div -->
4548
4549 ### <a id="_gtevalue-other"></a>`_.gte(value, other)`
4550 <a href="#_gtevalue-other">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10402 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.gte "See the npm package")
4551
4552 Checks if `value` is greater than or equal to `other`.
4553
4554 #### Since
4555 3.9.0
4556 #### Arguments
4557 1. `value` *(&#42;)*: The value to compare.
4558 2. `other` *(&#42;)*: The other value to compare.
4559
4560 #### Returns
4561 *(boolean)*: Returns `true` if `value` is greater than or equal to `other`, else `false`.
4562
4563 #### Example
4564 ```js
4565 _.gte(3, 1);
4566 // => true
4567
4568 _.gte(3, 3);
4569 // => true
4570
4571 _.gte(1, 3);
4572 // => false
4573 ```
4574 * * *
4575
4576 <!-- /div -->
4577
4578 <!-- div -->
4579
4580 ### <a id="_isargumentsvalue"></a>`_.isArguments(value)`
4581 <a href="#_isargumentsvalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10424 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.isarguments "See the npm package")
4582
4583 Checks if `value` is likely an `arguments` object.
4584
4585 #### Since
4586 0.1.0
4587 #### Arguments
4588 1. `value` *(&#42;)*: The value to check.
4589
4590 #### Returns
4591 *(boolean)*: Returns `true` if `value` is correctly classified, else `false`.
4592
4593 #### Example
4594 ```js
4595 _.isArguments(function() { return arguments; }());
4596 // => true
4597
4598 _.isArguments([1, 2, 3]);
4599 // => false
4600 ```
4601 * * *
4602
4603 <!-- /div -->
4604
4605 <!-- div -->
4606
4607 ### <a id="_isarrayvalue"></a>`_.isArray(value)`
4608 <a href="#_isarrayvalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10455 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.isarray "See the npm package")
4609
4610 Checks if `value` is classified as an `Array` object.
4611
4612 #### Since
4613 0.1.0
4614 #### Arguments
4615 1. `value` *(&#42;)*: The value to check.
4616
4617 #### Returns
4618 *(boolean)*: Returns `true` if `value` is correctly classified, else `false`.
4619
4620 #### Example
4621 ```js
4622 _.isArray([1, 2, 3]);
4623 // => true
4624
4625 _.isArray(document.body.children);
4626 // => false
4627
4628 _.isArray('abc');
4629 // => false
4630
4631 _.isArray(_.noop);
4632 // => false
4633 ```
4634 * * *
4635
4636 <!-- /div -->
4637
4638 <!-- div -->
4639
4640 ### <a id="_isarraybuffervalue"></a>`_.isArrayBuffer(value)`
4641 <a href="#_isarraybuffervalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10475 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.isarraybuffer "See the npm package")
4642
4643 Checks if `value` is classified as an `ArrayBuffer` object.
4644
4645 #### Since
4646 4.3.0
4647 #### Arguments
4648 1. `value` *(&#42;)*: The value to check.
4649
4650 #### Returns
4651 *(boolean)*: Returns `true` if `value` is correctly classified, else `false`.
4652
4653 #### Example
4654 ```js
4655 _.isArrayBuffer(new ArrayBuffer(2));
4656 // => true
4657
4658 _.isArrayBuffer(new Array(2));
4659 // => false
4660 ```
4661 * * *
4662
4663 <!-- /div -->
4664
4665 <!-- div -->
4666
4667 ### <a id="_isarraylikevalue"></a>`_.isArrayLike(value)`
4668 <a href="#_isarraylikevalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10504 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.isarraylike "See the npm package")
4669
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`.
4673
4674 #### Since
4675 4.0.0
4676 #### Arguments
4677 1. `value` *(&#42;)*: The value to check.
4678
4679 #### Returns
4680 *(boolean)*: Returns `true` if `value` is array-like, else `false`.
4681
4682 #### Example
4683 ```js
4684 _.isArrayLike([1, 2, 3]);
4685 // => true
4686
4687 _.isArrayLike(document.body.children);
4688 // => true
4689
4690 _.isArrayLike('abc');
4691 // => true
4692
4693 _.isArrayLike(_.noop);
4694 // => false
4695 ```
4696 * * *
4697
4698 <!-- /div -->
4699
4700 <!-- div -->
4701
4702 ### <a id="_isarraylikeobjectvalue"></a>`_.isArrayLikeObject(value)`
4703 <a href="#_isarraylikeobjectvalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10533 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.isarraylikeobject "See the npm package")
4704
4705 This method is like `_.isArrayLike` except that it also checks if `value`
4706 is an object.
4707
4708 #### Since
4709 4.0.0
4710 #### Arguments
4711 1. `value` *(&#42;)*: The value to check.
4712
4713 #### Returns
4714 *(boolean)*: Returns `true` if `value` is an array-like object, else `false`.
4715
4716 #### Example
4717 ```js
4718 _.isArrayLikeObject([1, 2, 3]);
4719 // => true
4720
4721 _.isArrayLikeObject(document.body.children);
4722 // => true
4723
4724 _.isArrayLikeObject('abc');
4725 // => false
4726
4727 _.isArrayLikeObject(_.noop);
4728 // => false
4729 ```
4730 * * *
4731
4732 <!-- /div -->
4733
4734 <!-- div -->
4735
4736 ### <a id="_isbooleanvalue"></a>`_.isBoolean(value)`
4737 <a href="#_isbooleanvalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10555 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.isboolean "See the npm package")
4738
4739 Checks if `value` is classified as a boolean primitive or object.
4740
4741 #### Since
4742 0.1.0
4743 #### Arguments
4744 1. `value` *(&#42;)*: The value to check.
4745
4746 #### Returns
4747 *(boolean)*: Returns `true` if `value` is correctly classified, else `false`.
4748
4749 #### Example
4750 ```js
4751 _.isBoolean(false);
4752 // => true
4753
4754 _.isBoolean(null);
4755 // => false
4756 ```
4757 * * *
4758
4759 <!-- /div -->
4760
4761 <!-- div -->
4762
4763 ### <a id="_isbuffervalue"></a>`_.isBuffer(value)`
4764 <a href="#_isbuffervalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10577 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.isbuffer "See the npm package")
4765
4766 Checks if `value` is a buffer.
4767
4768 #### Since
4769 4.3.0
4770 #### Arguments
4771 1. `value` *(&#42;)*: The value to check.
4772
4773 #### Returns
4774 *(boolean)*: Returns `true` if `value` is a buffer, else `false`.
4775
4776 #### Example
4777 ```js
4778 _.isBuffer(new Buffer(2));
4779 // => true
4780
4781 _.isBuffer(new Uint8Array(2));
4782 // => false
4783 ```
4784 * * *
4785
4786 <!-- /div -->
4787
4788 <!-- div -->
4789
4790 ### <a id="_isdatevalue"></a>`_.isDate(value)`
4791 <a href="#_isdatevalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10599 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.isdate "See the npm package")
4792
4793 Checks if `value` is classified as a `Date` object.
4794
4795 #### Since
4796 0.1.0
4797 #### Arguments
4798 1. `value` *(&#42;)*: The value to check.
4799
4800 #### Returns
4801 *(boolean)*: Returns `true` if `value` is correctly classified, else `false`.
4802
4803 #### Example
4804 ```js
4805 _.isDate(new Date);
4806 // => true
4807
4808 _.isDate('Mon April 23 2012');
4809 // => false
4810 ```
4811 * * *
4812
4813 <!-- /div -->
4814
4815 <!-- div -->
4816
4817 ### <a id="_iselementvalue"></a>`_.isElement(value)`
4818 <a href="#_iselementvalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10621 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.iselement "See the npm package")
4819
4820 Checks if `value` is likely a DOM element.
4821
4822 #### Since
4823 0.1.0
4824 #### Arguments
4825 1. `value` *(&#42;)*: The value to check.
4826
4827 #### Returns
4828 *(boolean)*: Returns `true` if `value` is a DOM element, else `false`.
4829
4830 #### Example
4831 ```js
4832 _.isElement(document.body);
4833 // => true
4834
4835 _.isElement('<body>');
4836 // => false
4837 ```
4838 * * *
4839
4840 <!-- /div -->
4841
4842 <!-- div -->
4843
4844 ### <a id="_isemptyvalue"></a>`_.isEmpty(value)`
4845 <a href="#_isemptyvalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10658 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.isempty "See the npm package")
4846
4847 Checks if `value` is an empty object, collection, map, or set.
4848 <br>
4849 <br>
4850 Objects are considered empty if they have no own enumerable string keyed
4851 properties.
4852 <br>
4853 <br>
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`.
4857
4858 #### Since
4859 0.1.0
4860 #### Arguments
4861 1. `value` *(&#42;)*: The value to check.
4862
4863 #### Returns
4864 *(boolean)*: Returns `true` if `value` is empty, else `false`.
4865
4866 #### Example
4867 ```js
4868 _.isEmpty(null);
4869 // => true
4870
4871 _.isEmpty(true);
4872 // => true
4873
4874 _.isEmpty(1);
4875 // => true
4876
4877 _.isEmpty([1, 2, 3]);
4878 // => false
4879
4880 _.isEmpty({ 'a': 1 });
4881 // => false
4882 ```
4883 * * *
4884
4885 <!-- /div -->
4886
4887 <!-- div -->
4888
4889 ### <a id="_isequalvalue-other"></a>`_.isEqual(value, other)`
4890 <a href="#_isequalvalue-other">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10707 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.isequal "See the npm package")
4891
4892 Performs a deep comparison between two values to determine if they are
4893 equivalent.
4894 <br>
4895 <br>
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.
4901
4902 #### Since
4903 0.1.0
4904 #### Arguments
4905 1. `value` *(&#42;)*: The value to compare.
4906 2. `other` *(&#42;)*: The other value to compare.
4907
4908 #### Returns
4909 *(boolean)*: Returns `true` if the values are equivalent, else `false`.
4910
4911 #### Example
4912 ```js
4913 var object = { 'user': 'fred' };
4914 var other = { 'user': 'fred' };
4915
4916 _.isEqual(object, other);
4917 // => true
4918
4919 object === other;
4920 // => false
4921 ```
4922 * * *
4923
4924 <!-- /div -->
4925
4926 <!-- div -->
4927
4928 ### <a id="_isequalwithvalue-other-customizer"></a>`_.isEqualWith(value, other, [customizer])`
4929 <a href="#_isequalwithvalue-other-customizer">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10744 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.isequalwith "See the npm package")
4930
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])*.
4935
4936 #### Since
4937 4.0.0
4938 #### Arguments
4939 1. `value` *(&#42;)*: The value to compare.
4940 2. `other` *(&#42;)*: The other value to compare.
4941 3. `[customizer]` *(Function)*: The function to customize comparisons.
4942
4943 #### Returns
4944 *(boolean)*: Returns `true` if the values are equivalent, else `false`.
4945
4946 #### Example
4947 ```js
4948 function isGreeting(value) {
4949   return /^h(?:i|ello)$/.test(value);
4950 }
4951
4952 function customizer(objValue, othValue) {
4953   if (isGreeting(objValue) && isGreeting(othValue)) {
4954     return true;
4955   }
4956 }
4957
4958 var array = ['hello', 'goodbye'];
4959 var other = ['hi', 'goodbye'];
4960
4961 _.isEqualWith(array, other, customizer);
4962 // => true
4963 ```
4964 * * *
4965
4966 <!-- /div -->
4967
4968 <!-- div -->
4969
4970 ### <a id="_iserrorvalue"></a>`_.isError(value)`
4971 <a href="#_iserrorvalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10769 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.iserror "See the npm package")
4972
4973 Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,
4974 `SyntaxError`, `TypeError`, or `URIError` object.
4975
4976 #### Since
4977 3.0.0
4978 #### Arguments
4979 1. `value` *(&#42;)*: The value to check.
4980
4981 #### Returns
4982 *(boolean)*: Returns `true` if `value` is an error object, else `false`.
4983
4984 #### Example
4985 ```js
4986 _.isError(new Error);
4987 // => true
4988
4989 _.isError(Error);
4990 // => false
4991 ```
4992 * * *
4993
4994 <!-- /div -->
4995
4996 <!-- div -->
4997
4998 ### <a id="_isfinitevalue"></a>`_.isFinite(value)`
4999 <a href="#_isfinitevalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10804 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.isfinite "See the npm package")
5000
5001 Checks if `value` is a finite primitive number.
5002 <br>
5003 <br>
5004 **Note:** This method is based on
5005 [`Number.isFinite`](https://mdn.io/Number/isFinite).
5006
5007 #### Since
5008 0.1.0
5009 #### Arguments
5010 1. `value` *(&#42;)*: The value to check.
5011
5012 #### Returns
5013 *(boolean)*: Returns `true` if `value` is a finite number, else `false`.
5014
5015 #### Example
5016 ```js
5017 _.isFinite(3);
5018 // => true
5019
5020 _.isFinite(Number.MAX_VALUE);
5021 // => true
5022
5023 _.isFinite(3.14);
5024 // => true
5025
5026 _.isFinite(Infinity);
5027 // => false
5028 ```
5029 * * *
5030
5031 <!-- /div -->
5032
5033 <!-- div -->
5034
5035 ### <a id="_isfunctionvalue"></a>`_.isFunction(value)`
5036 <a href="#_isfunctionvalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10826 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.isfunction "See the npm package")
5037
5038 Checks if `value` is classified as a `Function` object.
5039
5040 #### Since
5041 0.1.0
5042 #### Arguments
5043 1. `value` *(&#42;)*: The value to check.
5044
5045 #### Returns
5046 *(boolean)*: Returns `true` if `value` is correctly classified, else `false`.
5047
5048 #### Example
5049 ```js
5050 _.isFunction(_);
5051 // => true
5052
5053 _.isFunction(/abc/);
5054 // => false
5055 ```
5056 * * *
5057
5058 <!-- /div -->
5059
5060 <!-- div -->
5061
5062 ### <a id="_isintegervalue"></a>`_.isInteger(value)`
5063 <a href="#_isintegervalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10860 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.isinteger "See the npm package")
5064
5065 Checks if `value` is an integer.
5066 <br>
5067 <br>
5068 **Note:** This method is based on
5069 [`Number.isInteger`](https://mdn.io/Number/isInteger).
5070
5071 #### Since
5072 4.0.0
5073 #### Arguments
5074 1. `value` *(&#42;)*: The value to check.
5075
5076 #### Returns
5077 *(boolean)*: Returns `true` if `value` is an integer, else `false`.
5078
5079 #### Example
5080 ```js
5081 _.isInteger(3);
5082 // => true
5083
5084 _.isInteger(Number.MIN_VALUE);
5085 // => false
5086
5087 _.isInteger(Infinity);
5088 // => false
5089
5090 _.isInteger('3');
5091 // => false
5092 ```
5093 * * *
5094
5095 <!-- /div -->
5096
5097 <!-- div -->
5098
5099 ### <a id="_islengthvalue"></a>`_.isLength(value)`
5100 <a href="#_islengthvalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10891 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.islength "See the npm package")
5101
5102 Checks if `value` is a valid array-like length.
5103 <br>
5104 <br>
5105 **Note:** This function is loosely based on
5106 [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength).
5107
5108 #### Since
5109 4.0.0
5110 #### Arguments
5111 1. `value` *(&#42;)*: The value to check.
5112
5113 #### Returns
5114 *(boolean)*: Returns `true` if `value` is a valid length, else `false`.
5115
5116 #### Example
5117 ```js
5118 _.isLength(3);
5119 // => true
5120
5121 _.isLength(Number.MIN_VALUE);
5122 // => false
5123
5124 _.isLength(Infinity);
5125 // => false
5126
5127 _.isLength('3');
5128 // => false
5129 ```
5130 * * *
5131
5132 <!-- /div -->
5133
5134 <!-- div -->
5135
5136 ### <a id="_ismapvalue"></a>`_.isMap(value)`
5137 <a href="#_ismapvalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10972 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.ismap "See the npm package")
5138
5139 Checks if `value` is classified as a `Map` object.
5140
5141 #### Since
5142 4.3.0
5143 #### Arguments
5144 1. `value` *(&#42;)*: The value to check.
5145
5146 #### Returns
5147 *(boolean)*: Returns `true` if `value` is correctly classified, else `false`.
5148
5149 #### Example
5150 ```js
5151 _.isMap(new Map);
5152 // => true
5153
5154 _.isMap(new WeakMap);
5155 // => false
5156 ```
5157 * * *
5158
5159 <!-- /div -->
5160
5161 <!-- div -->
5162
5163 ### <a id="_ismatchobject-source"></a>`_.isMatch(object, source)`
5164 <a href="#_ismatchobject-source">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11000 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.ismatch "See the npm package")
5165
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.
5169 <br>
5170 <br>
5171 **Note:** This method supports comparing the same values as `_.isEqual`.
5172
5173 #### Since
5174 3.0.0
5175 #### Arguments
5176 1. `object` *(Object)*: The object to inspect.
5177 2. `source` *(Object)*: The object of property values to match.
5178
5179 #### Returns
5180 *(boolean)*: Returns `true` if `object` is a match, else `false`.
5181
5182 #### Example
5183 ```js
5184 var object = { 'user': 'fred', 'age': 40 };
5185
5186 _.isMatch(object, { 'age': 40 });
5187 // => true
5188
5189 _.isMatch(object, { 'age': 36 });
5190 // => false
5191 ```
5192 * * *
5193
5194 <!-- /div -->
5195
5196 <!-- div -->
5197
5198 ### <a id="_ismatchwithobject-source-customizer"></a>`_.isMatchWith(object, source, [customizer])`
5199 <a href="#_ismatchwithobject-source-customizer">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11036 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.ismatchwith "See the npm package")
5200
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)*.
5205
5206 #### Since
5207 4.0.0
5208 #### Arguments
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.
5212
5213 #### Returns
5214 *(boolean)*: Returns `true` if `object` is a match, else `false`.
5215
5216 #### Example
5217 ```js
5218 function isGreeting(value) {
5219   return /^h(?:i|ello)$/.test(value);
5220 }
5221
5222 function customizer(objValue, srcValue) {
5223   if (isGreeting(objValue) && isGreeting(srcValue)) {
5224     return true;
5225   }
5226 }
5227
5228 var object = { 'greeting': 'hello' };
5229 var source = { 'greeting': 'hi' };
5230
5231 _.isMatchWith(object, source, customizer);
5232 // => true
5233 ```
5234 * * *
5235
5236 <!-- /div -->
5237
5238 <!-- div -->
5239
5240 ### <a id="_isnanvalue"></a>`_.isNaN(value)`
5241 <a href="#_isnanvalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11069 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.isnan "See the npm package")
5242
5243 Checks if `value` is `NaN`.
5244 <br>
5245 <br>
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.
5250
5251 #### Since
5252 0.1.0
5253 #### Arguments
5254 1. `value` *(&#42;)*: The value to check.
5255
5256 #### Returns
5257 *(boolean)*: Returns `true` if `value` is `NaN`, else `false`.
5258
5259 #### Example
5260 ```js
5261 _.isNaN(NaN);
5262 // => true
5263
5264 _.isNaN(new Number(NaN));
5265 // => true
5266
5267 isNaN(undefined);
5268 // => true
5269
5270 _.isNaN(undefined);
5271 // => false
5272 ```
5273 * * *
5274
5275 <!-- /div -->
5276
5277 <!-- div -->
5278
5279 ### <a id="_isnativevalue"></a>`_.isNative(value)`
5280 <a href="#_isnativevalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11094 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.isnative "See the npm package")
5281
5282 Checks if `value` is a native function.
5283
5284 #### Since
5285 3.0.0
5286 #### Arguments
5287 1. `value` *(&#42;)*: The value to check.
5288
5289 #### Returns
5290 *(boolean)*: Returns `true` if `value` is a native function, else `false`.
5291
5292 #### Example
5293 ```js
5294 _.isNative(Array.prototype.push);
5295 // => true
5296
5297 _.isNative(_);
5298 // => false
5299 ```
5300 * * *
5301
5302 <!-- /div -->
5303
5304 <!-- div -->
5305
5306 ### <a id="_isnilvalue"></a>`_.isNil(value)`
5307 <a href="#_isnilvalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11143 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.isnil "See the npm package")
5308
5309 Checks if `value` is `null` or `undefined`.
5310
5311 #### Since
5312 4.0.0
5313 #### Arguments
5314 1. `value` *(&#42;)*: The value to check.
5315
5316 #### Returns
5317 *(boolean)*: Returns `true` if `value` is nullish, else `false`.
5318
5319 #### Example
5320 ```js
5321 _.isNil(null);
5322 // => true
5323
5324 _.isNil(void 0);
5325 // => true
5326
5327 _.isNil(NaN);
5328 // => false
5329 ```
5330 * * *
5331
5332 <!-- /div -->
5333
5334 <!-- div -->
5335
5336 ### <a id="_isnullvalue"></a>`_.isNull(value)`
5337 <a href="#_isnullvalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11119 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.isnull "See the npm package")
5338
5339 Checks if `value` is `null`.
5340
5341 #### Since
5342 0.1.0
5343 #### Arguments
5344 1. `value` *(&#42;)*: The value to check.
5345
5346 #### Returns
5347 *(boolean)*: Returns `true` if `value` is `null`, else `false`.
5348
5349 #### Example
5350 ```js
5351 _.isNull(null);
5352 // => true
5353
5354 _.isNull(void 0);
5355 // => false
5356 ```
5357 * * *
5358
5359 <!-- /div -->
5360
5361 <!-- div -->
5362
5363 ### <a id="_isnumbervalue"></a>`_.isNumber(value)`
5364 <a href="#_isnumbervalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11174 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.isnumber "See the npm package")
5365
5366 Checks if `value` is classified as a `Number` primitive or object.
5367 <br>
5368 <br>
5369 **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are
5370 classified as numbers, use the `_.isFinite` method.
5371
5372 #### Since
5373 0.1.0
5374 #### Arguments
5375 1. `value` *(&#42;)*: The value to check.
5376
5377 #### Returns
5378 *(boolean)*: Returns `true` if `value` is correctly classified, else `false`.
5379
5380 #### Example
5381 ```js
5382 _.isNumber(3);
5383 // => true
5384
5385 _.isNumber(Number.MIN_VALUE);
5386 // => true
5387
5388 _.isNumber(Infinity);
5389 // => true
5390
5391 _.isNumber('3');
5392 // => false
5393 ```
5394 * * *
5395
5396 <!-- /div -->
5397
5398 <!-- div -->
5399
5400 ### <a id="_isobjectvalue"></a>`_.isObject(value)`
5401 <a href="#_isobjectvalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10921 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.isobject "See the npm package")
5402
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('')`)*
5406
5407 #### Since
5408 0.1.0
5409 #### Arguments
5410 1. `value` *(&#42;)*: The value to check.
5411
5412 #### Returns
5413 *(boolean)*: Returns `true` if `value` is an object, else `false`.
5414
5415 #### Example
5416 ```js
5417 _.isObject({});
5418 // => true
5419
5420 _.isObject([1, 2, 3]);
5421 // => true
5422
5423 _.isObject(_.noop);
5424 // => true
5425
5426 _.isObject(null);
5427 // => false
5428 ```
5429 * * *
5430
5431 <!-- /div -->
5432
5433 <!-- div -->
5434
5435 ### <a id="_isobjectlikevalue"></a>`_.isObjectLike(value)`
5436 <a href="#_isobjectlikevalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L10950 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.isobjectlike "See the npm package")
5437
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".
5440
5441 #### Since
5442 4.0.0
5443 #### Arguments
5444 1. `value` *(&#42;)*: The value to check.
5445
5446 #### Returns
5447 *(boolean)*: Returns `true` if `value` is object-like, else `false`.
5448
5449 #### Example
5450 ```js
5451 _.isObjectLike({});
5452 // => true
5453
5454 _.isObjectLike([1, 2, 3]);
5455 // => true
5456
5457 _.isObjectLike(_.noop);
5458 // => false
5459
5460 _.isObjectLike(null);
5461 // => false
5462 ```
5463 * * *
5464
5465 <!-- /div -->
5466
5467 <!-- div -->
5468
5469 ### <a id="_isplainobjectvalue"></a>`_.isPlainObject(value)`
5470 <a href="#_isplainobjectvalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11208 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.isplainobject "See the npm package")
5471
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`.
5474
5475 #### Since
5476 0.8.0
5477 #### Arguments
5478 1. `value` *(&#42;)*: The value to check.
5479
5480 #### Returns
5481 *(boolean)*: Returns `true` if `value` is a plain object, else `false`.
5482
5483 #### Example
5484 ```js
5485 function Foo() {
5486   this.a = 1;
5487 }
5488
5489 _.isPlainObject(new Foo);
5490 // => false
5491
5492 _.isPlainObject([1, 2, 3]);
5493 // => false
5494
5495 _.isPlainObject({ 'x': 0, 'y': 0 });
5496 // => true
5497
5498 _.isPlainObject(Object.create(null));
5499 // => true
5500 ```
5501 * * *
5502
5503 <!-- /div -->
5504
5505 <!-- div -->
5506
5507 ### <a id="_isregexpvalue"></a>`_.isRegExp(value)`
5508 <a href="#_isregexpvalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11240 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.isregexp "See the npm package")
5509
5510 Checks if `value` is classified as a `RegExp` object.
5511
5512 #### Since
5513 0.1.0
5514 #### Arguments
5515 1. `value` *(&#42;)*: The value to check.
5516
5517 #### Returns
5518 *(boolean)*: Returns `true` if `value` is correctly classified, else `false`.
5519
5520 #### Example
5521 ```js
5522 _.isRegExp(/abc/);
5523 // => true
5524
5525 _.isRegExp('/abc/');
5526 // => false
5527 ```
5528 * * *
5529
5530 <!-- /div -->
5531
5532 <!-- div -->
5533
5534 ### <a id="_issafeintegervalue"></a>`_.isSafeInteger(value)`
5535 <a href="#_issafeintegervalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11272 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.issafeinteger "See the npm package")
5536
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.
5539 <br>
5540 <br>
5541 **Note:** This method is based on
5542 [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger).
5543
5544 #### Since
5545 4.0.0
5546 #### Arguments
5547 1. `value` *(&#42;)*: The value to check.
5548
5549 #### Returns
5550 *(boolean)*: Returns `true` if `value` is a safe integer, else `false`.
5551
5552 #### Example
5553 ```js
5554 _.isSafeInteger(3);
5555 // => true
5556
5557 _.isSafeInteger(Number.MIN_VALUE);
5558 // => false
5559
5560 _.isSafeInteger(Infinity);
5561 // => false
5562
5563 _.isSafeInteger('3');
5564 // => false
5565 ```
5566 * * *
5567
5568 <!-- /div -->
5569
5570 <!-- div -->
5571
5572 ### <a id="_issetvalue"></a>`_.isSet(value)`
5573 <a href="#_issetvalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11294 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.isset "See the npm package")
5574
5575 Checks if `value` is classified as a `Set` object.
5576
5577 #### Since
5578 4.3.0
5579 #### Arguments
5580 1. `value` *(&#42;)*: The value to check.
5581
5582 #### Returns
5583 *(boolean)*: Returns `true` if `value` is correctly classified, else `false`.
5584
5585 #### Example
5586 ```js
5587 _.isSet(new Set);
5588 // => true
5589
5590 _.isSet(new WeakSet);
5591 // => false
5592 ```
5593 * * *
5594
5595 <!-- /div -->
5596
5597 <!-- div -->
5598
5599 ### <a id="_isstringvalue"></a>`_.isString(value)`
5600 <a href="#_isstringvalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11316 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.isstring "See the npm package")
5601
5602 Checks if `value` is classified as a `String` primitive or object.
5603
5604 #### Since
5605 0.1.0
5606 #### Arguments
5607 1. `value` *(&#42;)*: The value to check.
5608
5609 #### Returns
5610 *(boolean)*: Returns `true` if `value` is correctly classified, else `false`.
5611
5612 #### Example
5613 ```js
5614 _.isString('abc');
5615 // => true
5616
5617 _.isString(1);
5618 // => false
5619 ```
5620 * * *
5621
5622 <!-- /div -->
5623
5624 <!-- div -->
5625
5626 ### <a id="_issymbolvalue"></a>`_.isSymbol(value)`
5627 <a href="#_issymbolvalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11339 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.issymbol "See the npm package")
5628
5629 Checks if `value` is classified as a `Symbol` primitive or object.
5630
5631 #### Since
5632 4.0.0
5633 #### Arguments
5634 1. `value` *(&#42;)*: The value to check.
5635
5636 #### Returns
5637 *(boolean)*: Returns `true` if `value` is correctly classified, else `false`.
5638
5639 #### Example
5640 ```js
5641 _.isSymbol(Symbol.iterator);
5642 // => true
5643
5644 _.isSymbol('abc');
5645 // => false
5646 ```
5647 * * *
5648
5649 <!-- /div -->
5650
5651 <!-- div -->
5652
5653 ### <a id="_istypedarrayvalue"></a>`_.isTypedArray(value)`
5654 <a href="#_istypedarrayvalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11362 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.istypedarray "See the npm package")
5655
5656 Checks if `value` is classified as a typed array.
5657
5658 #### Since
5659 3.0.0
5660 #### Arguments
5661 1. `value` *(&#42;)*: The value to check.
5662
5663 #### Returns
5664 *(boolean)*: Returns `true` if `value` is correctly classified, else `false`.
5665
5666 #### Example
5667 ```js
5668 _.isTypedArray(new Uint8Array);
5669 // => true
5670
5671 _.isTypedArray([]);
5672 // => false
5673 ```
5674 * * *
5675
5676 <!-- /div -->
5677
5678 <!-- div -->
5679
5680 ### <a id="_isundefinedvalue"></a>`_.isUndefined(value)`
5681 <a href="#_isundefinedvalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11384 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.isundefined "See the npm package")
5682
5683 Checks if `value` is `undefined`.
5684
5685 #### Since
5686 0.1.0
5687 #### Arguments
5688 1. `value` *(&#42;)*: The value to check.
5689
5690 #### Returns
5691 *(boolean)*: Returns `true` if `value` is `undefined`, else `false`.
5692
5693 #### Example
5694 ```js
5695 _.isUndefined(void 0);
5696 // => true
5697
5698 _.isUndefined(null);
5699 // => false
5700 ```
5701 * * *
5702
5703 <!-- /div -->
5704
5705 <!-- div -->
5706
5707 ### <a id="_isweakmapvalue"></a>`_.isWeakMap(value)`
5708 <a href="#_isweakmapvalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11406 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.isweakmap "See the npm package")
5709
5710 Checks if `value` is classified as a `WeakMap` object.
5711
5712 #### Since
5713 4.3.0
5714 #### Arguments
5715 1. `value` *(&#42;)*: The value to check.
5716
5717 #### Returns
5718 *(boolean)*: Returns `true` if `value` is correctly classified, else `false`.
5719
5720 #### Example
5721 ```js
5722 _.isWeakMap(new WeakMap);
5723 // => true
5724
5725 _.isWeakMap(new Map);
5726 // => false
5727 ```
5728 * * *
5729
5730 <!-- /div -->
5731
5732 <!-- div -->
5733
5734 ### <a id="_isweaksetvalue"></a>`_.isWeakSet(value)`
5735 <a href="#_isweaksetvalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11428 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.isweakset "See the npm package")
5736
5737 Checks if `value` is classified as a `WeakSet` object.
5738
5739 #### Since
5740 4.3.0
5741 #### Arguments
5742 1. `value` *(&#42;)*: The value to check.
5743
5744 #### Returns
5745 *(boolean)*: Returns `true` if `value` is correctly classified, else `false`.
5746
5747 #### Example
5748 ```js
5749 _.isWeakSet(new WeakSet);
5750 // => true
5751
5752 _.isWeakSet(new Set);
5753 // => false
5754 ```
5755 * * *
5756
5757 <!-- /div -->
5758
5759 <!-- div -->
5760
5761 ### <a id="_ltvalue-other"></a>`_.lt(value, other)`
5762 <a href="#_ltvalue-other">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11455 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.lt "See the npm package")
5763
5764 Checks if `value` is less than `other`.
5765
5766 #### Since
5767 3.9.0
5768 #### Arguments
5769 1. `value` *(&#42;)*: The value to compare.
5770 2. `other` *(&#42;)*: The other value to compare.
5771
5772 #### Returns
5773 *(boolean)*: Returns `true` if `value` is less than `other`, else `false`.
5774
5775 #### Example
5776 ```js
5777 _.lt(1, 3);
5778 // => true
5779
5780 _.lt(3, 3);
5781 // => false
5782
5783 _.lt(3, 1);
5784 // => false
5785 ```
5786 * * *
5787
5788 <!-- /div -->
5789
5790 <!-- div -->
5791
5792 ### <a id="_ltevalue-other"></a>`_.lte(value, other)`
5793 <a href="#_ltevalue-other">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11480 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.lte "See the npm package")
5794
5795 Checks if `value` is less than or equal to `other`.
5796
5797 #### Since
5798 3.9.0
5799 #### Arguments
5800 1. `value` *(&#42;)*: The value to compare.
5801 2. `other` *(&#42;)*: The other value to compare.
5802
5803 #### Returns
5804 *(boolean)*: Returns `true` if `value` is less than or equal to `other`, else `false`.
5805
5806 #### Example
5807 ```js
5808 _.lte(1, 3);
5809 // => true
5810
5811 _.lte(3, 3);
5812 // => true
5813
5814 _.lte(3, 1);
5815 // => false
5816 ```
5817 * * *
5818
5819 <!-- /div -->
5820
5821 <!-- div -->
5822
5823 ### <a id="_toarrayvalue"></a>`_.toArray(value)`
5824 <a href="#_toarrayvalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11507 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.toarray "See the npm package")
5825
5826 Converts `value` to an array.
5827
5828 #### Since
5829 0.1.0
5830 #### Arguments
5831 1. `value` *(&#42;)*: The value to convert.
5832
5833 #### Returns
5834 *(Array)*: Returns the converted array.
5835
5836 #### Example
5837 ```js
5838 _.toArray({ 'a': 1, 'b': 2 });
5839 // => [1, 2]
5840
5841 _.toArray('abc');
5842 // => ['a', 'b', 'c']
5843
5844 _.toArray(1);
5845 // => []
5846
5847 _.toArray(null);
5848 // => []
5849 ```
5850 * * *
5851
5852 <!-- /div -->
5853
5854 <!-- div -->
5855
5856 ### <a id="_tointegervalue"></a>`_.toInteger(value)`
5857 <a href="#_tointegervalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11549 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.tointeger "See the npm package")
5858
5859 Converts `value` to an integer.
5860 <br>
5861 <br>
5862 **Note:** This function is loosely based on
5863 [`ToInteger`](http://www.ecma-international.org/ecma-262/6.0/#sec-tointeger).
5864
5865 #### Since
5866 4.0.0
5867 #### Arguments
5868 1. `value` *(&#42;)*: The value to convert.
5869
5870 #### Returns
5871 *(number)*: Returns the converted integer.
5872
5873 #### Example
5874 ```js
5875 _.toInteger(3);
5876 // => 3
5877
5878 _.toInteger(Number.MIN_VALUE);
5879 // => 0
5880
5881 _.toInteger(Infinity);
5882 // => 1.7976931348623157e+308
5883
5884 _.toInteger('3');
5885 // => 3
5886 ```
5887 * * *
5888
5889 <!-- /div -->
5890
5891 <!-- div -->
5892
5893 ### <a id="_tolengthvalue"></a>`_.toLength(value)`
5894 <a href="#_tolengthvalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11589 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.tolength "See the npm package")
5895
5896 Converts `value` to an integer suitable for use as the length of an
5897 array-like object.
5898 <br>
5899 <br>
5900 **Note:** This method is based on
5901 [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength).
5902
5903 #### Since
5904 4.0.0
5905 #### Arguments
5906 1. `value` *(&#42;)*: The value to convert.
5907
5908 #### Returns
5909 *(number)*: Returns the converted integer.
5910
5911 #### Example
5912 ```js
5913 _.toLength(3);
5914 // => 3
5915
5916 _.toLength(Number.MIN_VALUE);
5917 // => 0
5918
5919 _.toLength(Infinity);
5920 // => 4294967295
5921
5922 _.toLength('3');
5923 // => 3
5924 ```
5925 * * *
5926
5927 <!-- /div -->
5928
5929 <!-- div -->
5930
5931 ### <a id="_tonumbervalue"></a>`_.toNumber(value)`
5932 <a href="#_tonumbervalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11616 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.tonumber "See the npm package")
5933
5934 Converts `value` to a number.
5935
5936 #### Since
5937 4.0.0
5938 #### Arguments
5939 1. `value` *(&#42;)*: The value to process.
5940
5941 #### Returns
5942 *(number)*: Returns the number.
5943
5944 #### Example
5945 ```js
5946 _.toNumber(3);
5947 // => 3
5948
5949 _.toNumber(Number.MIN_VALUE);
5950 // => 5e-324
5951
5952 _.toNumber(Infinity);
5953 // => Infinity
5954
5955 _.toNumber('3');
5956 // => 3
5957 ```
5958 * * *
5959
5960 <!-- /div -->
5961
5962 <!-- div -->
5963
5964 ### <a id="_toplainobjectvalue"></a>`_.toPlainObject(value)`
5965 <a href="#_toplainobjectvalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11661 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.toplainobject "See the npm package")
5966
5967 Converts `value` to a plain object flattening inherited enumerable string
5968 keyed properties of `value` to own properties of the plain object.
5969
5970 #### Since
5971 3.0.0
5972 #### Arguments
5973 1. `value` *(&#42;)*: The value to convert.
5974
5975 #### Returns
5976 *(Object)*: Returns the converted plain object.
5977
5978 #### Example
5979 ```js
5980 function Foo() {
5981   this.b = 2;
5982 }
5983
5984 Foo.prototype.c = 3;
5985
5986 _.assign({ 'a': 1 }, new Foo);
5987 // => { 'a': 1, 'b': 2 }
5988
5989 _.assign({ 'a': 1 }, _.toPlainObject(new Foo));
5990 // => { 'a': 1, 'b': 2, 'c': 3 }
5991 ```
5992 * * *
5993
5994 <!-- /div -->
5995
5996 <!-- div -->
5997
5998 ### <a id="_tosafeintegervalue"></a>`_.toSafeInteger(value)`
5999 <a href="#_tosafeintegervalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11689 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.tosafeinteger "See the npm package")
6000
6001 Converts `value` to a safe integer. A safe integer can be compared and
6002 represented correctly.
6003
6004 #### Since
6005 4.0.0
6006 #### Arguments
6007 1. `value` *(&#42;)*: The value to convert.
6008
6009 #### Returns
6010 *(number)*: Returns the converted integer.
6011
6012 #### Example
6013 ```js
6014 _.toSafeInteger(3);
6015 // => 3
6016
6017 _.toSafeInteger(Number.MIN_VALUE);
6018 // => 0
6019
6020 _.toSafeInteger(Infinity);
6021 // => 9007199254740991
6022
6023 _.toSafeInteger('3');
6024 // => 3
6025 ```
6026 * * *
6027
6028 <!-- /div -->
6029
6030 <!-- div -->
6031
6032 ### <a id="_tostringvalue"></a>`_.toString(value)`
6033 <a href="#_tostringvalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11714 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.tostring "See the npm package")
6034
6035 Converts `value` to a string. An empty string is returned for `null`
6036 and `undefined` values. The sign of `-0` is preserved.
6037
6038 #### Since
6039 4.0.0
6040 #### Arguments
6041 1. `value` *(&#42;)*: The value to process.
6042
6043 #### Returns
6044 *(string)*: Returns the string.
6045
6046 #### Example
6047 ```js
6048 _.toString(null);
6049 // => ''
6050
6051 _.toString(-0);
6052 // => '-0'
6053
6054 _.toString([1, 2, 3]);
6055 // => '1,2,3'
6056 ```
6057 * * *
6058
6059 <!-- /div -->
6060
6061 <!-- /div -->
6062
6063 <!-- div -->
6064
6065 ## `“Math” Methods`
6066
6067 <!-- div -->
6068
6069 ### <a id="_addaugend-addend"></a>`_.add(augend, addend)`
6070 <a href="#_addaugend-addend">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L15229 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.add "See the npm package")
6071
6072 Adds two numbers.
6073
6074 #### Since
6075 3.4.0
6076 #### Arguments
6077 1. `augend` *(number)*: The first number in an addition.
6078 2. `addend` *(number)*: The second number in an addition.
6079
6080 #### Returns
6081 *(number)*: Returns the total.
6082
6083 #### Example
6084 ```js
6085 _.add(6, 4);
6086 // => 10
6087 ```
6088 * * *
6089
6090 <!-- /div -->
6091
6092 <!-- div -->
6093
6094 ### <a id="_ceilnumber-precision0"></a>`_.ceil(number, [precision=0])`
6095 <a href="#_ceilnumber-precision0">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L15254 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.ceil "See the npm package")
6096
6097 Computes `number` rounded up to `precision`.
6098
6099 #### Since
6100 3.10.0
6101 #### Arguments
6102 1. `number` *(number)*: The number to round up.
6103 2. `[precision=0]` *(number)*: The precision to round up to.
6104
6105 #### Returns
6106 *(number)*: Returns the rounded up number.
6107
6108 #### Example
6109 ```js
6110 _.ceil(4.006);
6111 // => 5
6112
6113 _.ceil(6.004, 2);
6114 // => 6.01
6115
6116 _.ceil(6040, -2);
6117 // => 6100
6118 ```
6119 * * *
6120
6121 <!-- /div -->
6122
6123 <!-- div -->
6124
6125 ### <a id="_dividedividend-divisor"></a>`_.divide(dividend, divisor)`
6126 <a href="#_dividedividend-divisor">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L15271 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.divide "See the npm package")
6127
6128 Divide two numbers.
6129
6130 #### Since
6131 4.7.0
6132 #### Arguments
6133 1. `dividend` *(number)*: The first number in a division.
6134 2. `divisor` *(number)*: The second number in a division.
6135
6136 #### Returns
6137 *(number)*: Returns the quotient.
6138
6139 #### Example
6140 ```js
6141 _.divide(6, 4);
6142 // => 1.5
6143 ```
6144 * * *
6145
6146 <!-- /div -->
6147
6148 <!-- div -->
6149
6150 ### <a id="_floornumber-precision0"></a>`_.floor(number, [precision=0])`
6151 <a href="#_floornumber-precision0">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L15296 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.floor "See the npm package")
6152
6153 Computes `number` rounded down to `precision`.
6154
6155 #### Since
6156 3.10.0
6157 #### Arguments
6158 1. `number` *(number)*: The number to round down.
6159 2. `[precision=0]` *(number)*: The precision to round down to.
6160
6161 #### Returns
6162 *(number)*: Returns the rounded down number.
6163
6164 #### Example
6165 ```js
6166 _.floor(4.006);
6167 // => 4
6168
6169 _.floor(0.046, 2);
6170 // => 0.04
6171
6172 _.floor(4060, -2);
6173 // => 4000
6174 ```
6175 * * *
6176
6177 <!-- /div -->
6178
6179 <!-- div -->
6180
6181 ### <a id="_maxarray"></a>`_.max(array)`
6182 <a href="#_maxarray">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L15316 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.max "See the npm package")
6183
6184 Computes the maximum value of `array`. If `array` is empty or falsey,
6185 `undefined` is returned.
6186
6187 #### Since
6188 0.1.0
6189 #### Arguments
6190 1. `array` *(Array)*: The array to iterate over.
6191
6192 #### Returns
6193 *(&#42;)*: Returns the maximum value.
6194
6195 #### Example
6196 ```js
6197 _.max([4, 2, 8, 6]);
6198 // => 8
6199
6200 _.max([]);
6201 // => undefined
6202 ```
6203 * * *
6204
6205 <!-- /div -->
6206
6207 <!-- div -->
6208
6209 ### <a id="_maxbyarray-iteratee_identity"></a>`_.maxBy(array, [iteratee=_.identity])`
6210 <a href="#_maxbyarray-iteratee_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L15346 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.maxby "See the npm package")
6211
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)*.
6215
6216 #### Since
6217 4.0.0
6218 #### Arguments
6219 1. `array` *(Array)*: The array to iterate over.
6220 2. `[iteratee=_.identity]` *(Array|Function|Object|string)*: The iteratee invoked per element.
6221
6222 #### Returns
6223 *(&#42;)*: Returns the maximum value.
6224
6225 #### Example
6226 ```js
6227 var objects = [{ 'n': 1 }, { 'n': 2 }];
6228
6229 _.maxBy(objects, function(o) { return o.n; });
6230 // => { 'n': 2 }
6231
6232 // The `_.property` iteratee shorthand.
6233 _.maxBy(objects, 'n');
6234 // => { 'n': 2 }
6235 ```
6236 * * *
6237
6238 <!-- /div -->
6239
6240 <!-- div -->
6241
6242 ### <a id="_meanarray"></a>`_.mean(array)`
6243 <a href="#_meanarray">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L15366 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.mean "See the npm package")
6244
6245 Computes the mean of the values in `array`.
6246
6247 #### Since
6248 4.0.0
6249 #### Arguments
6250 1. `array` *(Array)*: The array to iterate over.
6251
6252 #### Returns
6253 *(number)*: Returns the mean.
6254
6255 #### Example
6256 ```js
6257 _.mean([4, 2, 8, 6]);
6258 // => 5
6259 ```
6260 * * *
6261
6262 <!-- /div -->
6263
6264 <!-- div -->
6265
6266 ### <a id="_meanbyarray-iteratee_identity"></a>`_.meanBy(array, [iteratee=_.identity])`
6267 <a href="#_meanbyarray-iteratee_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L15394 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.meanby "See the npm package")
6268
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)*.
6272
6273 #### Since
6274 4.7.0
6275 #### Arguments
6276 1. `array` *(Array)*: The array to iterate over.
6277 2. `[iteratee=_.identity]` *(Array|Function|Object|string)*: The iteratee invoked per element.
6278
6279 #### Returns
6280 *(number)*: Returns the mean.
6281
6282 #### Example
6283 ```js
6284 var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
6285
6286 _.meanBy(objects, function(o) { return o.n; });
6287 // => 5
6288
6289 // The `_.property` iteratee shorthand.
6290 _.meanBy(objects, 'n');
6291 // => 5
6292 ```
6293 * * *
6294
6295 <!-- /div -->
6296
6297 <!-- div -->
6298
6299 ### <a id="_minarray"></a>`_.min(array)`
6300 <a href="#_minarray">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L15416 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.min "See the npm package")
6301
6302 Computes the minimum value of `array`. If `array` is empty or falsey,
6303 `undefined` is returned.
6304
6305 #### Since
6306 0.1.0
6307 #### Arguments
6308 1. `array` *(Array)*: The array to iterate over.
6309
6310 #### Returns
6311 *(&#42;)*: Returns the minimum value.
6312
6313 #### Example
6314 ```js
6315 _.min([4, 2, 8, 6]);
6316 // => 2
6317
6318 _.min([]);
6319 // => undefined
6320 ```
6321 * * *
6322
6323 <!-- /div -->
6324
6325 <!-- div -->
6326
6327 ### <a id="_minbyarray-iteratee_identity"></a>`_.minBy(array, [iteratee=_.identity])`
6328 <a href="#_minbyarray-iteratee_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L15446 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.minby "See the npm package")
6329
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)*.
6333
6334 #### Since
6335 4.0.0
6336 #### Arguments
6337 1. `array` *(Array)*: The array to iterate over.
6338 2. `[iteratee=_.identity]` *(Array|Function|Object|string)*: The iteratee invoked per element.
6339
6340 #### Returns
6341 *(&#42;)*: Returns the minimum value.
6342
6343 #### Example
6344 ```js
6345 var objects = [{ 'n': 1 }, { 'n': 2 }];
6346
6347 _.minBy(objects, function(o) { return o.n; });
6348 // => { 'n': 1 }
6349
6350 // The `_.property` iteratee shorthand.
6351 _.minBy(objects, 'n');
6352 // => { 'n': 1 }
6353 ```
6354 * * *
6355
6356 <!-- /div -->
6357
6358 <!-- div -->
6359
6360 ### <a id="_multiplymultiplier-multiplicand"></a>`_.multiply(multiplier, multiplicand)`
6361 <a href="#_multiplymultiplier-multiplicand">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L15467 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.multiply "See the npm package")
6362
6363 Multiply two numbers.
6364
6365 #### Since
6366 4.7.0
6367 #### Arguments
6368 1. `multiplier` *(number)*: The first number in a multiplication.
6369 2. `multiplicand` *(number)*: The second number in a multiplication.
6370
6371 #### Returns
6372 *(number)*: Returns the product.
6373
6374 #### Example
6375 ```js
6376 _.multiply(6, 4);
6377 // => 24
6378 ```
6379 * * *
6380
6381 <!-- /div -->
6382
6383 <!-- div -->
6384
6385 ### <a id="_roundnumber-precision0"></a>`_.round(number, [precision=0])`
6386 <a href="#_roundnumber-precision0">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L15492 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.round "See the npm package")
6387
6388 Computes `number` rounded to `precision`.
6389
6390 #### Since
6391 3.10.0
6392 #### Arguments
6393 1. `number` *(number)*: The number to round.
6394 2. `[precision=0]` *(number)*: The precision to round to.
6395
6396 #### Returns
6397 *(number)*: Returns the rounded number.
6398
6399 #### Example
6400 ```js
6401 _.round(4.006);
6402 // => 4
6403
6404 _.round(4.006, 2);
6405 // => 4.01
6406
6407 _.round(4060, -2);
6408 // => 4100
6409 ```
6410 * * *
6411
6412 <!-- /div -->
6413
6414 <!-- div -->
6415
6416 ### <a id="_subtractminuend-subtrahend"></a>`_.subtract(minuend, subtrahend)`
6417 <a href="#_subtractminuend-subtrahend">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L15509 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.subtract "See the npm package")
6418
6419 Subtract two numbers.
6420
6421 #### Since
6422 4.0.0
6423 #### Arguments
6424 1. `minuend` *(number)*: The first number in a subtraction.
6425 2. `subtrahend` *(number)*: The second number in a subtraction.
6426
6427 #### Returns
6428 *(number)*: Returns the difference.
6429
6430 #### Example
6431 ```js
6432 _.subtract(6, 4);
6433 // => 2
6434 ```
6435 * * *
6436
6437 <!-- /div -->
6438
6439 <!-- div -->
6440
6441 ### <a id="_sumarray"></a>`_.sum(array)`
6442 <a href="#_sumarray">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L15527 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.sum "See the npm package")
6443
6444 Computes the sum of the values in `array`.
6445
6446 #### Since
6447 3.4.0
6448 #### Arguments
6449 1. `array` *(Array)*: The array to iterate over.
6450
6451 #### Returns
6452 *(number)*: Returns the sum.
6453
6454 #### Example
6455 ```js
6456 _.sum([4, 2, 8, 6]);
6457 // => 20
6458 ```
6459 * * *
6460
6461 <!-- /div -->
6462
6463 <!-- div -->
6464
6465 ### <a id="_sumbyarray-iteratee_identity"></a>`_.sumBy(array, [iteratee=_.identity])`
6466 <a href="#_sumbyarray-iteratee_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L15557 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.sumby "See the npm package")
6467
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)*.
6471
6472 #### Since
6473 4.0.0
6474 #### Arguments
6475 1. `array` *(Array)*: The array to iterate over.
6476 2. `[iteratee=_.identity]` *(Array|Function|Object|string)*: The iteratee invoked per element.
6477
6478 #### Returns
6479 *(number)*: Returns the sum.
6480
6481 #### Example
6482 ```js
6483 var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
6484
6485 _.sumBy(objects, function(o) { return o.n; });
6486 // => 20
6487
6488 // The `_.property` iteratee shorthand.
6489 _.sumBy(objects, 'n');
6490 // => 20
6491 ```
6492 * * *
6493
6494 <!-- /div -->
6495
6496 <!-- /div -->
6497
6498 <!-- div -->
6499
6500 ## `“Number” Methods`
6501
6502 <!-- div -->
6503
6504 ### <a id="_clampnumber-lower-upper"></a>`_.clamp(number, [lower], upper)`
6505 <a href="#_clampnumber-lower-upper">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L13139 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.clamp "See the npm package")
6506
6507 Clamps `number` within the inclusive `lower` and `upper` bounds.
6508
6509 #### Since
6510 4.0.0
6511 #### Arguments
6512 1. `number` *(number)*: The number to clamp.
6513 2. `[lower]` *(number)*: The lower bound.
6514 3. `upper` *(number)*: The upper bound.
6515
6516 #### Returns
6517 *(number)*: Returns the clamped number.
6518
6519 #### Example
6520 ```js
6521 _.clamp(-10, -5, 5);
6522 // => -5
6523
6524 _.clamp(10, -5, 5);
6525 // => 5
6526 ```
6527 * * *
6528
6529 <!-- /div -->
6530
6531 <!-- div -->
6532
6533 ### <a id="_inrangenumber-start0-end"></a>`_.inRange(number, [start=0], end)`
6534 <a href="#_inrangenumber-start0-end">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L13193 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.inrange "See the npm package")
6535
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
6539 negative ranges.
6540
6541 #### Since
6542 3.3.0
6543 #### Arguments
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.
6547
6548 #### Returns
6549 *(boolean)*: Returns `true` if `number` is in the range, else `false`.
6550
6551 #### Example
6552 ```js
6553 _.inRange(3, 2, 4);
6554 // => true
6555
6556 _.inRange(4, 8);
6557 // => true
6558
6559 _.inRange(4, 2);
6560 // => false
6561
6562 _.inRange(2, 2);
6563 // => false
6564
6565 _.inRange(1.2, 2);
6566 // => true
6567
6568 _.inRange(5.2, 4);
6569 // => false
6570
6571 _.inRange(-3, -2, -6);
6572 // => true
6573 ```
6574 * * *
6575
6576 <!-- /div -->
6577
6578 <!-- div -->
6579
6580 ### <a id="_randomlower0-upper1-floating"></a>`_.random([lower=0], [upper=1], [floating])`
6581 <a href="#_randomlower0-upper1-floating">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L13236 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.random "See the npm package")
6582
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.
6587 <br>
6588 <br>
6589 **Note:** JavaScript follows the IEEE-754 standard for resolving
6590 floating-point values which can produce unexpected results.
6591
6592 #### Since
6593 0.7.0
6594 #### Arguments
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.
6598
6599 #### Returns
6600 *(number)*: Returns the random number.
6601
6602 #### Example
6603 ```js
6604 _.random(0, 5);
6605 // => an integer between 0 and 5
6606
6607 _.random(5);
6608 // => also an integer between 0 and 5
6609
6610 _.random(5, true);
6611 // => a floating-point number between 0 and 5
6612
6613 _.random(1.2, 5.2);
6614 // => a floating-point number between 1.2 and 5.2
6615 ```
6616 * * *
6617
6618 <!-- /div -->
6619
6620 <!-- /div -->
6621
6622 <!-- div -->
6623
6624 ## `“Object” Methods`
6625
6626 <!-- div -->
6627
6628 ### <a id="_assignobject-sources"></a>`_.assign(object, [sources])`
6629 <a href="#_assignobject-sources">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11752 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.assign "See the npm package")
6630
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.
6634 <br>
6635 <br>
6636 **Note:** This method mutates `object` and is loosely based on
6637 [`Object.assign`](https://mdn.io/Object/assign).
6638
6639 #### Since
6640 0.10.0
6641 #### Arguments
6642 1. `object` *(Object)*: The destination object.
6643 2. `[sources]` *(...Object)*: The source objects.
6644
6645 #### Returns
6646 *(Object)*: Returns `object`.
6647
6648 #### Example
6649 ```js
6650 function Foo() {
6651   this.c = 3;
6652 }
6653
6654 function Bar() {
6655   this.e = 5;
6656 }
6657
6658 Foo.prototype.d = 4;
6659 Bar.prototype.f = 6;
6660
6661 _.assign({ 'a': 1 }, new Foo, new Bar);
6662 // => { 'a': 1, 'c': 3, 'e': 5 }
6663 ```
6664 * * *
6665
6666 <!-- /div -->
6667
6668 <!-- div -->
6669
6670 ### <a id="_assigninobject-sources"></a>`_.assignIn(object, [sources])`
6671 <a href="#_assigninobject-sources">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11795 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.assignin "See the npm package")
6672
6673 This method is like `_.assign` except that it iterates over own and
6674 inherited source properties.
6675 <br>
6676 <br>
6677 **Note:** This method mutates `object`.
6678
6679 #### Since
6680 4.0.0
6681 #### Aliases
6682 *_.extend*
6683
6684 #### Arguments
6685 1. `object` *(Object)*: The destination object.
6686 2. `[sources]` *(...Object)*: The source objects.
6687
6688 #### Returns
6689 *(Object)*: Returns `object`.
6690
6691 #### Example
6692 ```js
6693 function Foo() {
6694   this.b = 2;
6695 }
6696
6697 function Bar() {
6698   this.d = 4;
6699 }
6700
6701 Foo.prototype.c = 3;
6702 Bar.prototype.e = 5;
6703
6704 _.assignIn({ 'a': 1 }, new Foo, new Bar);
6705 // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5 }
6706 ```
6707 * * *
6708
6709 <!-- /div -->
6710
6711 <!-- div -->
6712
6713 ### <a id="_assigninwithobject-sources-customizer"></a>`_.assignInWith(object, sources, [customizer])`
6714 <a href="#_assigninwithobject-sources-customizer">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11834 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.assigninwith "See the npm package")
6715
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)*.
6720 <br>
6721 <br>
6722 **Note:** This method mutates `object`.
6723
6724 #### Since
6725 4.0.0
6726 #### Aliases
6727 *_.extendWith*
6728
6729 #### Arguments
6730 1. `object` *(Object)*: The destination object.
6731 2. `sources` *(...Object)*: The source objects.
6732 3. `[customizer]` *(Function)*: The function to customize assigned values.
6733
6734 #### Returns
6735 *(Object)*: Returns `object`.
6736
6737 #### Example
6738 ```js
6739 function customizer(objValue, srcValue) {
6740   return _.isUndefined(objValue) ? srcValue : objValue;
6741 }
6742
6743 var defaults = _.partialRight(_.assignInWith, customizer);
6744
6745 defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
6746 // => { 'a': 1, 'b': 2 }
6747 ```
6748 * * *
6749
6750 <!-- /div -->
6751
6752 <!-- div -->
6753
6754 ### <a id="_assignwithobject-sources-customizer"></a>`_.assignWith(object, sources, [customizer])`
6755 <a href="#_assignwithobject-sources-customizer">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11866 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.assignwith "See the npm package")
6756
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)*.
6761 <br>
6762 <br>
6763 **Note:** This method mutates `object`.
6764
6765 #### Since
6766 4.0.0
6767 #### Arguments
6768 1. `object` *(Object)*: The destination object.
6769 2. `sources` *(...Object)*: The source objects.
6770 3. `[customizer]` *(Function)*: The function to customize assigned values.
6771
6772 #### Returns
6773 *(Object)*: Returns `object`.
6774
6775 #### Example
6776 ```js
6777 function customizer(objValue, srcValue) {
6778   return _.isUndefined(objValue) ? srcValue : objValue;
6779 }
6780
6781 var defaults = _.partialRight(_.assignWith, customizer);
6782
6783 defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
6784 // => { 'a': 1, 'b': 2 }
6785 ```
6786 * * *
6787
6788 <!-- /div -->
6789
6790 <!-- div -->
6791
6792 ### <a id="_atobject-paths"></a>`_.at(object, [paths])`
6793 <a href="#_atobject-paths">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11890 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.at "See the npm package")
6794
6795 Creates an array of values corresponding to `paths` of `object`.
6796
6797 #### Since
6798 1.0.0
6799 #### Arguments
6800 1. `object` *(Object)*: The object to iterate over.
6801 2. `[paths]` *(...(string|string&#91;&#93;))*: The property paths of elements to pick.
6802
6803 #### Returns
6804 *(Array)*: Returns the new array of picked elements.
6805
6806 #### Example
6807 ```js
6808 var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
6809
6810 _.at(object, ['a[0].b.c', 'a[1]']);
6811 // => [3, 4]
6812
6813 _.at(['a', 'b', 'c'], 0, 2);
6814 // => ['a', 'c']
6815 ```
6816 * * *
6817
6818 <!-- /div -->
6819
6820 <!-- div -->
6821
6822 ### <a id="_createprototype-properties"></a>`_.create(prototype, [properties])`
6823 <a href="#_createprototype-properties">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11928 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.create "See the npm package")
6824
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.
6828
6829 #### Since
6830 2.3.0
6831 #### Arguments
6832 1. `prototype` *(Object)*: The object to inherit from.
6833 2. `[properties]` *(Object)*: The properties to assign to the object.
6834
6835 #### Returns
6836 *(Object)*: Returns the new object.
6837
6838 #### Example
6839 ```js
6840 function Shape() {
6841   this.x = 0;
6842   this.y = 0;
6843 }
6844
6845 function Circle() {
6846   Shape.call(this);
6847 }
6848
6849 Circle.prototype = _.create(Shape.prototype, {
6850   'constructor': Circle
6851 });
6852
6853 var circle = new Circle;
6854 circle instanceof Circle;
6855 // => true
6856
6857 circle instanceof Shape;
6858 // => true
6859 ```
6860 * * *
6861
6862 <!-- /div -->
6863
6864 <!-- div -->
6865
6866 ### <a id="_defaultsobject-sources"></a>`_.defaults(object, [sources])`
6867 <a href="#_defaultsobject-sources">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11954 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.defaults "See the npm package")
6868
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.
6873 <br>
6874 <br>
6875 **Note:** This method mutates `object`.
6876
6877 #### Since
6878 0.1.0
6879 #### Arguments
6880 1. `object` *(Object)*: The destination object.
6881 2. `[sources]` *(...Object)*: The source objects.
6882
6883 #### Returns
6884 *(Object)*: Returns `object`.
6885
6886 #### Example
6887 ```js
6888 _.defaults({ 'user': 'barney' }, { 'age': 36 }, { 'user': 'fred' });
6889 // => { 'user': 'barney', 'age': 36 }
6890 ```
6891 * * *
6892
6893 <!-- /div -->
6894
6895 <!-- div -->
6896
6897 ### <a id="_defaultsdeepobject-sources"></a>`_.defaultsDeep(object, [sources])`
6898 <a href="#_defaultsdeepobject-sources">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L11979 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.defaultsdeep "See the npm package")
6899
6900 This method is like `_.defaults` except that it recursively assigns
6901 default properties.
6902 <br>
6903 <br>
6904 **Note:** This method mutates `object`.
6905
6906 #### Since
6907 3.10.0
6908 #### Arguments
6909 1. `object` *(Object)*: The destination object.
6910 2. `[sources]` *(...Object)*: The source objects.
6911
6912 #### Returns
6913 *(Object)*: Returns `object`.
6914
6915 #### Example
6916 ```js
6917 _.defaultsDeep({ 'user': { 'name': 'barney' } }, { 'user': { 'name': 'fred', 'age': 36 } });
6918 // => { 'user': { 'name': 'barney', 'age': 36 } }
6919 ```
6920 * * *
6921
6922 <!-- /div -->
6923
6924 <!-- div -->
6925
6926 ### <a id="_findkeyobject-predicate_identity"></a>`_.findKey(object, [predicate=_.identity])`
6927 <a href="#_findkeyobject-predicate_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L12020 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.findkey "See the npm package")
6928
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.
6931
6932 #### Since
6933 1.1.0
6934 #### Arguments
6935 1. `object` *(Object)*: The object to search.
6936 2. `[predicate=_.identity]` *(Array|Function|Object|string)*: The function invoked per iteration.
6937
6938 #### Returns
6939 *(&#42;)*: Returns the key of the matched element, else `undefined`.
6940
6941 #### Example
6942 ```js
6943 var users = {
6944   'barney':  { 'age': 36, 'active': true },
6945   'fred':    { 'age': 40, 'active': false },
6946   'pebbles': { 'age': 1,  'active': true }
6947 };
6948
6949 _.findKey(users, function(o) { return o.age < 40; });
6950 // => 'barney' (iteration order is not guaranteed)
6951
6952 // The `_.matches` iteratee shorthand.
6953 _.findKey(users, { 'age': 1, 'active': true });
6954 // => 'pebbles'
6955
6956 // The `_.matchesProperty` iteratee shorthand.
6957 _.findKey(users, ['active', false]);
6958 // => 'fred'
6959
6960 // The `_.property` iteratee shorthand.
6961 _.findKey(users, 'active');
6962 // => 'barney'
6963 ```
6964 * * *
6965
6966 <!-- /div -->
6967
6968 <!-- div -->
6969
6970 ### <a id="_findlastkeyobject-predicate_identity"></a>`_.findLastKey(object, [predicate=_.identity])`
6971 <a href="#_findlastkeyobject-predicate_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L12060 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.findlastkey "See the npm package")
6972
6973 This method is like `_.findKey` except that it iterates over elements of
6974 a collection in the opposite order.
6975
6976 #### Since
6977 2.0.0
6978 #### Arguments
6979 1. `object` *(Object)*: The object to search.
6980 2. `[predicate=_.identity]` *(Array|Function|Object|string)*: The function invoked per iteration.
6981
6982 #### Returns
6983 *(&#42;)*: Returns the key of the matched element, else `undefined`.
6984
6985 #### Example
6986 ```js
6987 var users = {
6988   'barney':  { 'age': 36, 'active': true },
6989   'fred':    { 'age': 40, 'active': false },
6990   'pebbles': { 'age': 1,  'active': true }
6991 };
6992
6993 _.findLastKey(users, function(o) { return o.age < 40; });
6994 // => returns 'pebbles' assuming `_.findKey` returns 'barney'
6995
6996 // The `_.matches` iteratee shorthand.
6997 _.findLastKey(users, { 'age': 36, 'active': true });
6998 // => 'barney'
6999
7000 // The `_.matchesProperty` iteratee shorthand.
7001 _.findLastKey(users, ['active', false]);
7002 // => 'fred'
7003
7004 // The `_.property` iteratee shorthand.
7005 _.findLastKey(users, 'active');
7006 // => 'pebbles'
7007 ```
7008 * * *
7009
7010 <!-- /div -->
7011
7012 <!-- div -->
7013
7014 ### <a id="_forinobject-iteratee_identity"></a>`_.forIn(object, [iteratee=_.identity])`
7015 <a href="#_forinobject-iteratee_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L12092 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.forin "See the npm package")
7016
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`.
7021
7022 #### Since
7023 0.3.0
7024 #### Arguments
7025 1. `object` *(Object)*: The object to iterate over.
7026 2. `[iteratee=_.identity]` *(Function)*: The function invoked per iteration.
7027
7028 #### Returns
7029 *(Object)*: Returns `object`.
7030
7031 #### Example
7032 ```js
7033 function Foo() {
7034   this.a = 1;
7035   this.b = 2;
7036 }
7037
7038 Foo.prototype.c = 3;
7039
7040 _.forIn(new Foo, function(value, key) {
7041   console.log(key);
7042 });
7043 // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed).
7044 ```
7045 * * *
7046
7047 <!-- /div -->
7048
7049 <!-- div -->
7050
7051 ### <a id="_forinrightobject-iteratee_identity"></a>`_.forInRight(object, [iteratee=_.identity])`
7052 <a href="#_forinrightobject-iteratee_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L12124 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.forinright "See the npm package")
7053
7054 This method is like `_.forIn` except that it iterates over properties of
7055 `object` in the opposite order.
7056
7057 #### Since
7058 2.0.0
7059 #### Arguments
7060 1. `object` *(Object)*: The object to iterate over.
7061 2. `[iteratee=_.identity]` *(Function)*: The function invoked per iteration.
7062
7063 #### Returns
7064 *(Object)*: Returns `object`.
7065
7066 #### Example
7067 ```js
7068 function Foo() {
7069   this.a = 1;
7070   this.b = 2;
7071 }
7072
7073 Foo.prototype.c = 3;
7074
7075 _.forInRight(new Foo, function(value, key) {
7076   console.log(key);
7077 });
7078 // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'.
7079 ```
7080 * * *
7081
7082 <!-- /div -->
7083
7084 <!-- div -->
7085
7086 ### <a id="_forownobject-iteratee_identity"></a>`_.forOwn(object, [iteratee=_.identity])`
7087 <a href="#_forownobject-iteratee_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L12158 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.forown "See the npm package")
7088
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`.
7093
7094 #### Since
7095 0.3.0
7096 #### Arguments
7097 1. `object` *(Object)*: The object to iterate over.
7098 2. `[iteratee=_.identity]` *(Function)*: The function invoked per iteration.
7099
7100 #### Returns
7101 *(Object)*: Returns `object`.
7102
7103 #### Example
7104 ```js
7105 function Foo() {
7106   this.a = 1;
7107   this.b = 2;
7108 }
7109
7110 Foo.prototype.c = 3;
7111
7112 _.forOwn(new Foo, function(value, key) {
7113   console.log(key);
7114 });
7115 // => Logs 'a' then 'b' (iteration order is not guaranteed).
7116 ```
7117 * * *
7118
7119 <!-- /div -->
7120
7121 <!-- div -->
7122
7123 ### <a id="_forownrightobject-iteratee_identity"></a>`_.forOwnRight(object, [iteratee=_.identity])`
7124 <a href="#_forownrightobject-iteratee_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L12188 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.forownright "See the npm package")
7125
7126 This method is like `_.forOwn` except that it iterates over properties of
7127 `object` in the opposite order.
7128
7129 #### Since
7130 2.0.0
7131 #### Arguments
7132 1. `object` *(Object)*: The object to iterate over.
7133 2. `[iteratee=_.identity]` *(Function)*: The function invoked per iteration.
7134
7135 #### Returns
7136 *(Object)*: Returns `object`.
7137
7138 #### Example
7139 ```js
7140 function Foo() {
7141   this.a = 1;
7142   this.b = 2;
7143 }
7144
7145 Foo.prototype.c = 3;
7146
7147 _.forOwnRight(new Foo, function(value, key) {
7148   console.log(key);
7149 });
7150 // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'.
7151 ```
7152 * * *
7153
7154 <!-- /div -->
7155
7156 <!-- div -->
7157
7158 ### <a id="_functionsobject"></a>`_.functions(object)`
7159 <a href="#_functionsobject">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L12215 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.functions "See the npm package")
7160
7161 Creates an array of function property names from own enumerable properties
7162 of `object`.
7163
7164 #### Since
7165 0.1.0
7166 #### Arguments
7167 1. `object` *(Object)*: The object to inspect.
7168
7169 #### Returns
7170 *(Array)*: Returns the new array of property names.
7171
7172 #### Example
7173 ```js
7174 function Foo() {
7175   this.a = _.constant('a');
7176   this.b = _.constant('b');
7177 }
7178
7179 Foo.prototype.c = _.constant('c');
7180
7181 _.functions(new Foo);
7182 // => ['a', 'b']
7183 ```
7184 * * *
7185
7186 <!-- /div -->
7187
7188 <!-- div -->
7189
7190 ### <a id="_functionsinobject"></a>`_.functionsIn(object)`
7191 <a href="#_functionsinobject">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L12242 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.functionsin "See the npm package")
7192
7193 Creates an array of function property names from own and inherited
7194 enumerable properties of `object`.
7195
7196 #### Since
7197 4.0.0
7198 #### Arguments
7199 1. `object` *(Object)*: The object to inspect.
7200
7201 #### Returns
7202 *(Array)*: Returns the new array of property names.
7203
7204 #### Example
7205 ```js
7206 function Foo() {
7207   this.a = _.constant('a');
7208   this.b = _.constant('b');
7209 }
7210
7211 Foo.prototype.c = _.constant('c');
7212
7213 _.functionsIn(new Foo);
7214 // => ['a', 'b', 'c']
7215 ```
7216 * * *
7217
7218 <!-- /div -->
7219
7220 <!-- div -->
7221
7222 ### <a id="_getobject-path-defaultvalue"></a>`_.get(object, path, [defaultValue])`
7223 <a href="#_getobject-path-defaultvalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L12271 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.get "See the npm package")
7224
7225 Gets the value at `path` of `object`. If the resolved value is
7226 `undefined`, the `defaultValue` is used in its place.
7227
7228 #### Since
7229 3.7.0
7230 #### Arguments
7231 1. `object` *(Object)*: The object to query.
7232 2. `path` *(Array|string)*: The path of the property to get.
7233 3. `[defaultValue]` *(&#42;)*: The value returned for `undefined` resolved values.
7234
7235 #### Returns
7236 *(&#42;)*: Returns the resolved value.
7237
7238 #### Example
7239 ```js
7240 var object = { 'a': [{ 'b': { 'c': 3 } }] };
7241
7242 _.get(object, 'a[0].b.c');
7243 // => 3
7244
7245 _.get(object, ['a', '0', 'b', 'c']);
7246 // => 3
7247
7248 _.get(object, 'a.b.c', 'default');
7249 // => 'default'
7250 ```
7251 * * *
7252
7253 <!-- /div -->
7254
7255 <!-- div -->
7256
7257 ### <a id="_hasobject-path"></a>`_.has(object, path)`
7258 <a href="#_hasobject-path">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L12303 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.has "See the npm package")
7259
7260 Checks if `path` is a direct property of `object`.
7261
7262 #### Since
7263 0.1.0
7264 #### Arguments
7265 1. `object` *(Object)*: The object to query.
7266 2. `path` *(Array|string)*: The path to check.
7267
7268 #### Returns
7269 *(boolean)*: Returns `true` if `path` exists, else `false`.
7270
7271 #### Example
7272 ```js
7273 var object = { 'a': { 'b': 2 } };
7274 var other = _.create({ 'a': _.create({ 'b': 2 }) });
7275
7276 _.has(object, 'a');
7277 // => true
7278
7279 _.has(object, 'a.b');
7280 // => true
7281
7282 _.has(object, ['a', 'b']);
7283 // => true
7284
7285 _.has(other, 'a');
7286 // => false
7287 ```
7288 * * *
7289
7290 <!-- /div -->
7291
7292 <!-- div -->
7293
7294 ### <a id="_hasinobject-path"></a>`_.hasIn(object, path)`
7295 <a href="#_hasinobject-path">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L12333 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.hasin "See the npm package")
7296
7297 Checks if `path` is a direct or inherited property of `object`.
7298
7299 #### Since
7300 4.0.0
7301 #### Arguments
7302 1. `object` *(Object)*: The object to query.
7303 2. `path` *(Array|string)*: The path to check.
7304
7305 #### Returns
7306 *(boolean)*: Returns `true` if `path` exists, else `false`.
7307
7308 #### Example
7309 ```js
7310 var object = _.create({ 'a': _.create({ 'b': 2 }) });
7311
7312 _.hasIn(object, 'a');
7313 // => true
7314
7315 _.hasIn(object, 'a.b');
7316 // => true
7317
7318 _.hasIn(object, ['a', 'b']);
7319 // => true
7320
7321 _.hasIn(object, 'b');
7322 // => false
7323 ```
7324 * * *
7325
7326 <!-- /div -->
7327
7328 <!-- div -->
7329
7330 ### <a id="_invertobject"></a>`_.invert(object)`
7331 <a href="#_invertobject">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L12355 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.invert "See the npm package")
7332
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.
7336
7337 #### Since
7338 0.7.0
7339 #### Arguments
7340 1. `object` *(Object)*: The object to invert.
7341
7342 #### Returns
7343 *(Object)*: Returns the new inverted object.
7344
7345 #### Example
7346 ```js
7347 var object = { 'a': 1, 'b': 2, 'c': 1 };
7348
7349 _.invert(object);
7350 // => { '1': 'c', '2': 'b' }
7351 ```
7352 * * *
7353
7354 <!-- /div -->
7355
7356 <!-- div -->
7357
7358 ### <a id="_invertbyobject-iteratee_identity"></a>`_.invertBy(object, [iteratee=_.identity])`
7359 <a href="#_invertbyobject-iteratee_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L12386 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.invertby "See the npm package")
7360
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)*.
7366
7367 #### Since
7368 4.1.0
7369 #### Arguments
7370 1. `object` *(Object)*: The object to invert.
7371 2. `[iteratee=_.identity]` *(Array|Function|Object|string)*: The iteratee invoked per element.
7372
7373 #### Returns
7374 *(Object)*: Returns the new inverted object.
7375
7376 #### Example
7377 ```js
7378 var object = { 'a': 1, 'b': 2, 'c': 1 };
7379
7380 _.invertBy(object);
7381 // => { '1': ['a', 'c'], '2': ['b'] }
7382
7383 _.invertBy(object, function(value) {
7384   return 'group' + value;
7385 });
7386 // => { 'group1': ['a', 'c'], 'group2': ['b'] }
7387 ```
7388 * * *
7389
7390 <!-- /div -->
7391
7392 <!-- div -->
7393
7394 ### <a id="_invokeobject-path-args"></a>`_.invoke(object, path, [args])`
7395 <a href="#_invokeobject-path-args">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L12412 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.invoke "See the npm package")
7396
7397 Invokes the method at `path` of `object`.
7398
7399 #### Since
7400 4.0.0
7401 #### Arguments
7402 1. `object` *(Object)*: The object to query.
7403 2. `path` *(Array|string)*: The path of the method to invoke.
7404 3. `[args]` *(...&#42;)*: The arguments to invoke the method with.
7405
7406 #### Returns
7407 *(&#42;)*: Returns the result of the invoked method.
7408
7409 #### Example
7410 ```js
7411 var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] };
7412
7413 _.invoke(object, 'a[0].b.c.slice', 1, 3);
7414 // => [2, 3]
7415 ```
7416 * * *
7417
7418 <!-- /div -->
7419
7420 <!-- div -->
7421
7422 ### <a id="_keysobject"></a>`_.keys(object)`
7423 <a href="#_keysobject">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L12442 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.keys "See the npm package")
7424
7425 Creates an array of the own enumerable property names of `object`.
7426 <br>
7427 <br>
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)
7430 for more details.
7431
7432 #### Since
7433 0.1.0
7434 #### Arguments
7435 1. `object` *(Object)*: The object to query.
7436
7437 #### Returns
7438 *(Array)*: Returns the array of property names.
7439
7440 #### Example
7441 ```js
7442 function Foo() {
7443   this.a = 1;
7444   this.b = 2;
7445 }
7446
7447 Foo.prototype.c = 3;
7448
7449 _.keys(new Foo);
7450 // => ['a', 'b'] (iteration order is not guaranteed)
7451
7452 _.keys('hi');
7453 // => ['0', '1']
7454 ```
7455 * * *
7456
7457 <!-- /div -->
7458
7459 <!-- div -->
7460
7461 ### <a id="_keysinobject"></a>`_.keysIn(object)`
7462 <a href="#_keysinobject">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L12485 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.keysin "See the npm package")
7463
7464 Creates an array of the own and inherited enumerable property names of `object`.
7465 <br>
7466 <br>
7467 **Note:** Non-object values are coerced to objects.
7468
7469 #### Since
7470 3.0.0
7471 #### Arguments
7472 1. `object` *(Object)*: The object to query.
7473
7474 #### Returns
7475 *(Array)*: Returns the array of property names.
7476
7477 #### Example
7478 ```js
7479 function Foo() {
7480   this.a = 1;
7481   this.b = 2;
7482 }
7483
7484 Foo.prototype.c = 3;
7485
7486 _.keysIn(new Foo);
7487 // => ['a', 'b', 'c'] (iteration order is not guaranteed)
7488 ```
7489 * * *
7490
7491 <!-- /div -->
7492
7493 <!-- div -->
7494
7495 ### <a id="_mapkeysobject-iteratee_identity"></a>`_.mapKeys(object, [iteratee=_.identity])`
7496 <a href="#_mapkeysobject-iteratee_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L12527 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.mapkeys "See the npm package")
7497
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)*.
7502
7503 #### Since
7504 3.8.0
7505 #### Arguments
7506 1. `object` *(Object)*: The object to iterate over.
7507 2. `[iteratee=_.identity]` *(Array|Function|Object|string)*: The function invoked per iteration.
7508
7509 #### Returns
7510 *(Object)*: Returns the new mapped object.
7511
7512 #### Example
7513 ```js
7514 _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {
7515   return key + value;
7516 });
7517 // => { 'a1': 1, 'b2': 2 }
7518 ```
7519 * * *
7520
7521 <!-- /div -->
7522
7523 <!-- div -->
7524
7525 ### <a id="_mapvaluesobject-iteratee_identity"></a>`_.mapValues(object, [iteratee=_.identity])`
7526 <a href="#_mapvaluesobject-iteratee_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L12566 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.mapvalues "See the npm package")
7527
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)*.
7532
7533 #### Since
7534 2.4.0
7535 #### Arguments
7536 1. `object` *(Object)*: The object to iterate over.
7537 2. `[iteratee=_.identity]` *(Array|Function|Object|string)*: The function invoked per iteration.
7538
7539 #### Returns
7540 *(Object)*: Returns the new mapped object.
7541
7542 #### Example
7543 ```js
7544 var users = {
7545   'fred':    { 'user': 'fred',    'age': 40 },
7546   'pebbles': { 'user': 'pebbles', 'age': 1 }
7547 };
7548
7549 _.mapValues(users, function(o) { return o.age; });
7550 // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
7551
7552 // The `_.property` iteratee shorthand.
7553 _.mapValues(users, 'age');
7554 // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
7555 ```
7556 * * *
7557
7558 <!-- /div -->
7559
7560 <!-- div -->
7561
7562 ### <a id="_mergeobject-sources"></a>`_.merge(object, [sources])`
7563 <a href="#_mergeobject-sources">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L12607 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.merge "See the npm package")
7564
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.
7572 <br>
7573 <br>
7574 **Note:** This method mutates `object`.
7575
7576 #### Since
7577 0.5.0
7578 #### Arguments
7579 1. `object` *(Object)*: The destination object.
7580 2. `[sources]` *(...Object)*: The source objects.
7581
7582 #### Returns
7583 *(Object)*: Returns `object`.
7584
7585 #### Example
7586 ```js
7587 var users = {
7588   'data': [{ 'user': 'barney' }, { 'user': 'fred' }]
7589 };
7590
7591 var ages = {
7592   'data': [{ 'age': 36 }, { 'age': 40 }]
7593 };
7594
7595 _.merge(users, ages);
7596 // => { 'data': [{ 'user': 'barney', 'age': 36 }, { 'user': 'fred', 'age': 40 }] }
7597 ```
7598 * * *
7599
7600 <!-- /div -->
7601
7602 <!-- div -->
7603
7604 ### <a id="_mergewithobject-sources-customizer"></a>`_.mergeWith(object, sources, customizer)`
7605 <a href="#_mergewithobject-sources-customizer">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L12649 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.mergewith "See the npm package")
7606
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)*.
7612 <br>
7613 <br>
7614 **Note:** This method mutates `object`.
7615
7616 #### Since
7617 4.0.0
7618 #### Arguments
7619 1. `object` *(Object)*: The destination object.
7620 2. `sources` *(...Object)*: The source objects.
7621 3. `customizer` *(Function)*: The function to customize assigned values.
7622
7623 #### Returns
7624 *(Object)*: Returns `object`.
7625
7626 #### Example
7627 ```js
7628 function customizer(objValue, srcValue) {
7629   if (_.isArray(objValue)) {
7630     return objValue.concat(srcValue);
7631   }
7632 }
7633
7634 var object = {
7635   'fruits': ['apple'],
7636   'vegetables': ['beet']
7637 };
7638
7639 var other = {
7640   'fruits': ['banana'],
7641   'vegetables': ['carrot']
7642 };
7643
7644 _.mergeWith(object, other, customizer);
7645 // => { 'fruits': ['apple', 'banana'], 'vegetables': ['beet', 'carrot'] }
7646 ```
7647 * * *
7648
7649 <!-- /div -->
7650
7651 <!-- div -->
7652
7653 ### <a id="_omitobject-props"></a>`_.omit(object, [props])`
7654 <a href="#_omitobject-props">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L12672 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.omit "See the npm package")
7655
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
7658 not omitted.
7659
7660 #### Since
7661 0.1.0
7662 #### Arguments
7663 1. `object` *(Object)*: The source object.
7664 2. `[props]` *(...(string|string&#91;&#93;))*: The property identifiers to omit.
7665
7666 #### Returns
7667 *(Object)*: Returns the new object.
7668
7669 #### Example
7670 ```js
7671 var object = { 'a': 1, 'b': '2', 'c': 3 };
7672
7673 _.omit(object, ['a', 'c']);
7674 // => { 'b': '2' }
7675 ```
7676 * * *
7677
7678 <!-- /div -->
7679
7680 <!-- div -->
7681
7682 ### <a id="_omitbyobject-predicate_identity"></a>`_.omitBy(object, [predicate=_.identity])`
7683 <a href="#_omitbyobject-predicate_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L12701 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.omitby "See the npm package")
7684
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)*.
7689
7690 #### Since
7691 4.0.0
7692 #### Arguments
7693 1. `object` *(Object)*: The source object.
7694 2. `[predicate=_.identity]` *(Array|Function|Object|string)*: The function invoked per property.
7695
7696 #### Returns
7697 *(Object)*: Returns the new object.
7698
7699 #### Example
7700 ```js
7701 var object = { 'a': 1, 'b': '2', 'c': 3 };
7702
7703 _.omitBy(object, _.isNumber);
7704 // => { 'b': '2' }
7705 ```
7706 * * *
7707
7708 <!-- /div -->
7709
7710 <!-- div -->
7711
7712 ### <a id="_pickobject-props"></a>`_.pick(object, [props])`
7713 <a href="#_pickobject-props">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L12725 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.pick "See the npm package")
7714
7715 Creates an object composed of the picked `object` properties.
7716
7717 #### Since
7718 0.1.0
7719 #### Arguments
7720 1. `object` *(Object)*: The source object.
7721 2. `[props]` *(...(string|string&#91;&#93;))*: The property identifiers to pick.
7722
7723 #### Returns
7724 *(Object)*: Returns the new object.
7725
7726 #### Example
7727 ```js
7728 var object = { 'a': 1, 'b': '2', 'c': 3 };
7729
7730 _.pick(object, ['a', 'c']);
7731 // => { 'a': 1, 'c': 3 }
7732 ```
7733 * * *
7734
7735 <!-- /div -->
7736
7737 <!-- div -->
7738
7739 ### <a id="_pickbyobject-predicate_identity"></a>`_.pickBy(object, [predicate=_.identity])`
7740 <a href="#_pickbyobject-predicate_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L12748 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.pickby "See the npm package")
7741
7742 Creates an object composed of the `object` properties `predicate` returns
7743 truthy for. The predicate is invoked with two arguments: *(value, key)*.
7744
7745 #### Since
7746 4.0.0
7747 #### Arguments
7748 1. `object` *(Object)*: The source object.
7749 2. `[predicate=_.identity]` *(Array|Function|Object|string)*: The function invoked per property.
7750
7751 #### Returns
7752 *(Object)*: Returns the new object.
7753
7754 #### Example
7755 ```js
7756 var object = { 'a': 1, 'b': '2', 'c': 3 };
7757
7758 _.pickBy(object, _.isNumber);
7759 // => { 'a': 1, 'c': 3 }
7760 ```
7761 * * *
7762
7763 <!-- /div -->
7764
7765 <!-- div -->
7766
7767 ### <a id="_resultobject-path-defaultvalue"></a>`_.result(object, path, [defaultValue])`
7768 <a href="#_resultobject-path-defaultvalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L12781 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.result "See the npm package")
7769
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.
7773
7774 #### Since
7775 0.1.0
7776 #### Arguments
7777 1. `object` *(Object)*: The object to query.
7778 2. `path` *(Array|string)*: The path of the property to resolve.
7779 3. `[defaultValue]` *(&#42;)*: The value returned for `undefined` resolved values.
7780
7781 #### Returns
7782 *(&#42;)*: Returns the resolved value.
7783
7784 #### Example
7785 ```js
7786 var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };
7787
7788 _.result(object, 'a[0].b.c1');
7789 // => 3
7790
7791 _.result(object, 'a[0].b.c2');
7792 // => 4
7793
7794 _.result(object, 'a[0].b.c3', 'default');
7795 // => 'default'
7796
7797 _.result(object, 'a[0].b.c3', _.constant('default'));
7798 // => 'default'
7799 ```
7800 * * *
7801
7802 <!-- /div -->
7803
7804 <!-- div -->
7805
7806 ### <a id="_setobject-path-value"></a>`_.set(object, path, value)`
7807 <a href="#_setobject-path-value">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L12831 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.set "See the npm package")
7808
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
7812 `path` creation.
7813 <br>
7814 <br>
7815 **Note:** This method mutates `object`.
7816
7817 #### Since
7818 3.7.0
7819 #### Arguments
7820 1. `object` *(Object)*: The object to modify.
7821 2. `path` *(Array|string)*: The path of the property to set.
7822 3. `value` *(&#42;)*: The value to set.
7823
7824 #### Returns
7825 *(Object)*: Returns `object`.
7826
7827 #### Example
7828 ```js
7829 var object = { 'a': [{ 'b': { 'c': 3 } }] };
7830
7831 _.set(object, 'a[0].b.c', 4);
7832 console.log(object.a[0].b.c);
7833 // => 4
7834
7835 _.set(object, ['x', '0', 'y', 'z'], 5);
7836 console.log(object.x[0].y.z);
7837 // => 5
7838 ```
7839 * * *
7840
7841 <!-- /div -->
7842
7843 <!-- div -->
7844
7845 ### <a id="_setwithobject-path-value-customizer"></a>`_.setWith(object, path, value, [customizer])`
7846 <a href="#_setwithobject-path-value-customizer">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L12859 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.setwith "See the npm package")
7847
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)*.
7852 <br>
7853 <br>
7854 **Note:** This method mutates `object`.
7855
7856 #### Since
7857 4.0.0
7858 #### Arguments
7859 1. `object` *(Object)*: The object to modify.
7860 2. `path` *(Array|string)*: The path of the property to set.
7861 3. `value` *(&#42;)*: The value to set.
7862 4. `[customizer]` *(Function)*: The function to customize assigned values.
7863
7864 #### Returns
7865 *(Object)*: Returns `object`.
7866
7867 #### Example
7868 ```js
7869 var object = {};
7870
7871 _.setWith(object, '[0][1]', 'a', Object);
7872 // => { '0': { '1': 'a' } }
7873 ```
7874 * * *
7875
7876 <!-- /div -->
7877
7878 <!-- div -->
7879
7880 ### <a id="_topairsobject"></a>`_.toPairs(object)`
7881 <a href="#_topairsobject">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L12887 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.topairs "See the npm package")
7882
7883 Creates an array of own enumerable string keyed-value pairs for `object`
7884 which can be consumed by `_.fromPairs`.
7885
7886 #### Since
7887 4.0.0
7888 #### Aliases
7889 *_.entries*
7890
7891 #### Arguments
7892 1. `object` *(Object)*: The object to query.
7893
7894 #### Returns
7895 *(Array)*: Returns the new array of key-value pairs.
7896
7897 #### Example
7898 ```js
7899 function Foo() {
7900   this.a = 1;
7901   this.b = 2;
7902 }
7903
7904 Foo.prototype.c = 3;
7905
7906 _.toPairs(new Foo);
7907 // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)
7908 ```
7909 * * *
7910
7911 <!-- /div -->
7912
7913 <!-- div -->
7914
7915 ### <a id="_topairsinobject"></a>`_.toPairsIn(object)`
7916 <a href="#_topairsinobject">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L12914 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.topairsin "See the npm package")
7917
7918 Creates an array of own and inherited enumerable string keyed-value pairs
7919 for `object` which can be consumed by `_.fromPairs`.
7920
7921 #### Since
7922 4.0.0
7923 #### Aliases
7924 *_.entriesIn*
7925
7926 #### Arguments
7927 1. `object` *(Object)*: The object to query.
7928
7929 #### Returns
7930 *(Array)*: Returns the new array of key-value pairs.
7931
7932 #### Example
7933 ```js
7934 function Foo() {
7935   this.a = 1;
7936   this.b = 2;
7937 }
7938
7939 Foo.prototype.c = 3;
7940
7941 _.toPairsIn(new Foo);
7942 // => [['a', 1], ['b', 2], ['c', 1]] (iteration order is not guaranteed)
7943 ```
7944 * * *
7945
7946 <!-- /div -->
7947
7948 <!-- div -->
7949
7950 ### <a id="_transformobject-iteratee_identity-accumulator"></a>`_.transform(object, [iteratee=_.identity], [accumulator])`
7951 <a href="#_transformobject-iteratee_identity-accumulator">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L12947 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.transform "See the npm package")
7952
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`.
7959
7960 #### Since
7961 1.3.0
7962 #### Arguments
7963 1. `object` *(Array|Object)*: The object to iterate over.
7964 2. `[iteratee=_.identity]` *(Function)*: The function invoked per iteration.
7965 3. `[accumulator]` *(&#42;)*: The custom accumulator value.
7966
7967 #### Returns
7968 *(&#42;)*: Returns the accumulated value.
7969
7970 #### Example
7971 ```js
7972 _.transform([2, 3, 4], function(result, n) {
7973   result.push(n *= n);
7974   return n % 2 == 0;
7975 }, []);
7976 // => [4, 9]
7977
7978 _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
7979   (result[value] || (result[value] = [])).push(key);
7980 }, {});
7981 // => { '1': ['a', 'c'], '2': ['b'] }
7982 ```
7983 * * *
7984
7985 <!-- /div -->
7986
7987 <!-- div -->
7988
7989 ### <a id="_unsetobject-path"></a>`_.unset(object, path)`
7990 <a href="#_unsetobject-path">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L12996 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.unset "See the npm package")
7991
7992 Removes the property at `path` of `object`.
7993 <br>
7994 <br>
7995 **Note:** This method mutates `object`.
7996
7997 #### Since
7998 4.0.0
7999 #### Arguments
8000 1. `object` *(Object)*: The object to modify.
8001 2. `path` *(Array|string)*: The path of the property to unset.
8002
8003 #### Returns
8004 *(boolean)*: Returns `true` if the property is deleted, else `false`.
8005
8006 #### Example
8007 ```js
8008 var object = { 'a': [{ 'b': { 'c': 7 } }] };
8009 _.unset(object, 'a[0].b.c');
8010 // => true
8011
8012 console.log(object);
8013 // => { 'a': [{ 'b': {} }] };
8014
8015 _.unset(object, ['a', '0', 'b', 'c']);
8016 // => true
8017
8018 console.log(object);
8019 // => { 'a': [{ 'b': {} }] };
8020 ```
8021 * * *
8022
8023 <!-- /div -->
8024
8025 <!-- div -->
8026
8027 ### <a id="_updateobject-path-updater"></a>`_.update(object, path, updater)`
8028 <a href="#_updateobject-path-updater">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L13027 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.update "See the npm package")
8029
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)*.
8033 <br>
8034 <br>
8035 **Note:** This method mutates `object`.
8036
8037 #### Since
8038 4.6.0
8039 #### Arguments
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.
8043
8044 #### Returns
8045 *(Object)*: Returns `object`.
8046
8047 #### Example
8048 ```js
8049 var object = { 'a': [{ 'b': { 'c': 3 } }] };
8050
8051 _.update(object, 'a[0].b.c', function(n) { return n * n; });
8052 console.log(object.a[0].b.c);
8053 // => 9
8054
8055 _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; });
8056 console.log(object.x[0].y.z);
8057 // => 0
8058 ```
8059 * * *
8060
8061 <!-- /div -->
8062
8063 <!-- div -->
8064
8065 ### <a id="_updatewithobject-path-updater-customizer"></a>`_.updateWith(object, path, updater, [customizer])`
8066 <a href="#_updatewithobject-path-updater-customizer">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L13055 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.updatewith "See the npm package")
8067
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)*.
8072 <br>
8073 <br>
8074 **Note:** This method mutates `object`.
8075
8076 #### Since
8077 4.6.0
8078 #### Arguments
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.
8083
8084 #### Returns
8085 *(Object)*: Returns `object`.
8086
8087 #### Example
8088 ```js
8089 var object = {};
8090
8091 _.updateWith(object, '[0][1]', _.constant('a'), Object);
8092 // => { '0': { '1': 'a' } }
8093 ```
8094 * * *
8095
8096 <!-- /div -->
8097
8098 <!-- div -->
8099
8100 ### <a id="_valuesobject"></a>`_.values(object)`
8101 <a href="#_valuesobject">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L13086 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.values "See the npm package")
8102
8103 Creates an array of the own enumerable string keyed property values of `object`.
8104 <br>
8105 <br>
8106 **Note:** Non-object values are coerced to objects.
8107
8108 #### Since
8109 0.1.0
8110 #### Arguments
8111 1. `object` *(Object)*: The object to query.
8112
8113 #### Returns
8114 *(Array)*: Returns the array of property values.
8115
8116 #### Example
8117 ```js
8118 function Foo() {
8119   this.a = 1;
8120   this.b = 2;
8121 }
8122
8123 Foo.prototype.c = 3;
8124
8125 _.values(new Foo);
8126 // => [1, 2] (iteration order is not guaranteed)
8127
8128 _.values('hi');
8129 // => ['h', 'i']
8130 ```
8131 * * *
8132
8133 <!-- /div -->
8134
8135 <!-- div -->
8136
8137 ### <a id="_valuesinobject"></a>`_.valuesIn(object)`
8138 <a href="#_valuesinobject">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L13114 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.valuesin "See the npm package")
8139
8140 Creates an array of the own and inherited enumerable string keyed property
8141 values of `object`.
8142 <br>
8143 <br>
8144 **Note:** Non-object values are coerced to objects.
8145
8146 #### Since
8147 3.0.0
8148 #### Arguments
8149 1. `object` *(Object)*: The object to query.
8150
8151 #### Returns
8152 *(Array)*: Returns the array of property values.
8153
8154 #### Example
8155 ```js
8156 function Foo() {
8157   this.a = 1;
8158   this.b = 2;
8159 }
8160
8161 Foo.prototype.c = 3;
8162
8163 _.valuesIn(new Foo);
8164 // => [1, 2, 3] (iteration order is not guaranteed)
8165 ```
8166 * * *
8167
8168 <!-- /div -->
8169
8170 <!-- /div -->
8171
8172 <!-- div -->
8173
8174 ## `“Seq” Methods`
8175
8176 <!-- div -->
8177
8178 ### <a id="_value"></a>`_(value)`
8179 <a href="#_value">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L1457 "View in source") [&#x24C9;][1]
8180
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
8186 with `_#value`.
8187 <br>
8188 <br>
8189 Explicit chain sequences, which must be unwrapped with `_#value`, may be
8190 enabled using `_.chain`.
8191 <br>
8192 <br>
8193 The execution of chained methods is lazy, that is, it's deferred until
8194 `_#value` is implicitly or explicitly called.
8195 <br>
8196 <br>
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.
8204 <br>
8205 <br>
8206 Chaining is supported in custom builds as long as the `_#value` method is
8207 directly or indirectly included in the build.
8208 <br>
8209 <br>
8210 In addition to lodash methods, wrappers have `Array` and `String` methods.
8211 <br>
8212 <br>
8213 The wrapper `Array` methods are:<br>
8214 `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`
8215 <br>
8216 <br>
8217 The wrapper `String` methods are:<br>
8218 `replace` and `split`
8219 <br>
8220 <br>
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`
8225 <br>
8226 <br>
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`
8252 <br>
8253 <br>
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`
8278
8279 #### Arguments
8280 1. `value` *(&#42;)*: The value to wrap in a `lodash` instance.
8281
8282 #### Returns
8283 *(Object)*: Returns the new `lodash` wrapper instance.
8284
8285 #### Example
8286 ```js
8287 function square(n) {
8288   return n * n;
8289 }
8290
8291 var wrapped = _([1, 2, 3]);
8292
8293 // Returns an unwrapped value.
8294 wrapped.reduce(_.add);
8295 // => 6
8296
8297 // Returns a wrapped value.
8298 var squares = wrapped.map(square);
8299
8300 _.isArray(squares);
8301 // => false
8302
8303 _.isArray(squares.value());
8304 // => true
8305 ```
8306 * * *
8307
8308 <!-- /div -->
8309
8310 <!-- div -->
8311
8312 ### <a id="_chainvalue"></a>`_.chain(value)`
8313 <a href="#_chainvalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7876 "View in source") [&#x24C9;][1]
8314
8315 Creates a `lodash` wrapper instance that wraps `value` with explicit method
8316 chain sequences enabled. The result of such sequences must be unwrapped
8317 with `_#value`.
8318
8319 #### Since
8320 1.3.0
8321 #### Arguments
8322 1. `value` *(&#42;)*: The value to wrap.
8323
8324 #### Returns
8325 *(Object)*: Returns the new `lodash` wrapper instance.
8326
8327 #### Example
8328 ```js
8329 var users = [
8330   { 'user': 'barney',  'age': 36 },
8331   { 'user': 'fred',    'age': 40 },
8332   { 'user': 'pebbles', 'age': 1 }
8333 ];
8334
8335 var youngest = _
8336   .chain(users)
8337   .sortBy('age')
8338   .map(function(o) {
8339     return o.user + ' is ' + o.age;
8340   })
8341   .head()
8342   .value();
8343 // => 'pebbles is 1'
8344 ```
8345 * * *
8346
8347 <!-- /div -->
8348
8349 <!-- div -->
8350
8351 ### <a id="_tapvalue-interceptor"></a>`_.tap(value, interceptor)`
8352 <a href="#_tapvalue-interceptor">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7905 "View in source") [&#x24C9;][1]
8353
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.
8357
8358 #### Since
8359 0.1.0
8360 #### Arguments
8361 1. `value` *(&#42;)*: The value to provide to `interceptor`.
8362 2. `interceptor` *(Function)*: The function to invoke.
8363
8364 #### Returns
8365 *(&#42;)*: Returns `value`.
8366
8367 #### Example
8368 ```js
8369 _([1, 2, 3])
8370  .tap(function(array) {
8371    // Mutate input array.
8372    array.pop();
8373  })
8374  .reverse()
8375  .value();
8376 // => [2, 1]
8377 ```
8378 * * *
8379
8380 <!-- /div -->
8381
8382 <!-- div -->
8383
8384 ### <a id="_thruvalue-interceptor"></a>`_.thru(value, interceptor)`
8385 <a href="#_thruvalue-interceptor">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7933 "View in source") [&#x24C9;][1]
8386
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.
8390
8391 #### Since
8392 3.0.0
8393 #### Arguments
8394 1. `value` *(&#42;)*: The value to provide to `interceptor`.
8395 2. `interceptor` *(Function)*: The function to invoke.
8396
8397 #### Returns
8398 *(&#42;)*: Returns the result of `interceptor`.
8399
8400 #### Example
8401 ```js
8402 _('  abc  ')
8403  .chain()
8404  .trim()
8405  .thru(function(value) {
8406    return [value];
8407  })
8408  .value();
8409 // => ['abc']
8410 ```
8411 * * *
8412
8413 <!-- /div -->
8414
8415 <!-- div -->
8416
8417 ### <a id="_prototypesymboliterator"></a>`_.prototype[Symbol.iterator]()`
8418 <a href="#_prototypesymboliterator">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L8092 "View in source") [&#x24C9;][1]
8419
8420 Enables the wrapper to be iterable.
8421
8422 #### Since
8423 4.0.0
8424 #### Returns
8425 *(Object)*: Returns the wrapper object.
8426
8427 #### Example
8428 ```js
8429 var wrapped = _([1, 2]);
8430
8431 wrapped[Symbol.iterator]() === wrapped;
8432 // => true
8433
8434 Array.from(wrapped);
8435 // => [1, 2]
8436 ```
8437 * * *
8438
8439 <!-- /div -->
8440
8441 <!-- div -->
8442
8443 ### <a id="_prototypeatpaths"></a>`_.prototype.at([paths])`
8444 <a href="#_prototypeatpaths">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L7956 "View in source") [&#x24C9;][1]
8445
8446 This method is the wrapper version of `_.at`.
8447
8448 #### Since
8449 1.0.0
8450 #### Arguments
8451 1. `[paths]` *(...(string|string&#91;&#93;))*: The property paths of elements to pick.
8452
8453 #### Returns
8454 *(Object)*: Returns the new `lodash` wrapper instance.
8455
8456 #### Example
8457 ```js
8458 var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
8459
8460 _(object).at(['a[0].b.c', 'a[1]']).value();
8461 // => [3, 4]
8462
8463 _(['a', 'b', 'c']).at(0, 2).value();
8464 // => ['a', 'c']
8465 ```
8466 * * *
8467
8468 <!-- /div -->
8469
8470 <!-- div -->
8471
8472 ### <a id="_prototypechain"></a>`_.prototype.chain()`
8473 <a href="#_prototypechain">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L8008 "View in source") [&#x24C9;][1]
8474
8475 Creates a `lodash` wrapper instance with explicit method chain sequences enabled.
8476
8477 #### Since
8478 0.1.0
8479 #### Returns
8480 *(Object)*: Returns the new `lodash` wrapper instance.
8481
8482 #### Example
8483 ```js
8484 var users = [
8485   { 'user': 'barney', 'age': 36 },
8486   { 'user': 'fred',   'age': 40 }
8487 ];
8488
8489 // A sequence without explicit chaining.
8490 _(users).head();
8491 // => { 'user': 'barney', 'age': 36 }
8492
8493 // A sequence with explicit chaining.
8494 _(users)
8495   .chain()
8496   .head()
8497   .pick('user')
8498   .value();
8499 // => { 'user': 'barney' }
8500 ```
8501 * * *
8502
8503 <!-- /div -->
8504
8505 <!-- div -->
8506
8507 ### <a id="_prototypecommit"></a>`_.prototype.commit()`
8508 <a href="#_prototypecommit">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L8038 "View in source") [&#x24C9;][1]
8509
8510 Executes the chain sequence and returns the wrapped result.
8511
8512 #### Since
8513 3.2.0
8514 #### Returns
8515 *(Object)*: Returns the new `lodash` wrapper instance.
8516
8517 #### Example
8518 ```js
8519 var array = [1, 2];
8520 var wrapped = _(array).push(3);
8521
8522 console.log(array);
8523 // => [1, 2]
8524
8525 wrapped = wrapped.commit();
8526 console.log(array);
8527 // => [1, 2, 3]
8528
8529 wrapped.last();
8530 // => 3
8531
8532 console.log(array);
8533 // => [1, 2, 3]
8534 ```
8535 * * *
8536
8537 <!-- /div -->
8538
8539 <!-- div -->
8540
8541 ### <a id="_prototypenext"></a>`_.prototype.next()`
8542 <a href="#_prototypenext">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L8064 "View in source") [&#x24C9;][1]
8543
8544 Gets the next value on a wrapped object following the
8545 [iterator protocol](https://mdn.io/iteration_protocols#iterator).
8546
8547 #### Since
8548 4.0.0
8549 #### Returns
8550 *(Object)*: Returns the next iterator value.
8551
8552 #### Example
8553 ```js
8554 var wrapped = _([1, 2]);
8555
8556 wrapped.next();
8557 // => { 'done': false, 'value': 1 }
8558
8559 wrapped.next();
8560 // => { 'done': false, 'value': 2 }
8561
8562 wrapped.next();
8563 // => { 'done': true, 'value': undefined }
8564 ```
8565 * * *
8566
8567 <!-- /div -->
8568
8569 <!-- div -->
8570
8571 ### <a id="_prototypeplantvalue"></a>`_.prototype.plant(value)`
8572 <a href="#_prototypeplantvalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L8120 "View in source") [&#x24C9;][1]
8573
8574 Creates a clone of the chain sequence planting `value` as the wrapped value.
8575
8576 #### Since
8577 3.2.0
8578 #### Arguments
8579 1. `value` *(&#42;)*: The value to plant.
8580
8581 #### Returns
8582 *(Object)*: Returns the new `lodash` wrapper instance.
8583
8584 #### Example
8585 ```js
8586 function square(n) {
8587   return n * n;
8588 }
8589
8590 var wrapped = _([1, 2]).map(square);
8591 var other = wrapped.plant([3, 4]);
8592
8593 other.value();
8594 // => [9, 16]
8595
8596 wrapped.value();
8597 // => [1, 4]
8598 ```
8599 * * *
8600
8601 <!-- /div -->
8602
8603 <!-- div -->
8604
8605 ### <a id="_prototypereverse"></a>`_.prototype.reverse()`
8606 <a href="#_prototypereverse">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L8160 "View in source") [&#x24C9;][1]
8607
8608 This method is the wrapper version of `_.reverse`.
8609 <br>
8610 <br>
8611 **Note:** This method mutates the wrapped array.
8612
8613 #### Since
8614 0.1.0
8615 #### Returns
8616 *(Object)*: Returns the new `lodash` wrapper instance.
8617
8618 #### Example
8619 ```js
8620 var array = [1, 2, 3];
8621
8622 _(array).reverse().value()
8623 // => [3, 2, 1]
8624
8625 console.log(array);
8626 // => [3, 2, 1]
8627 ```
8628 * * *
8629
8630 <!-- /div -->
8631
8632 <!-- div -->
8633
8634 ### <a id="_prototypevalue"></a>`_.prototype.value()`
8635 <a href="#_prototypevalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L8192 "View in source") [&#x24C9;][1]
8636
8637 Executes the chain sequence to resolve the unwrapped value.
8638
8639 #### Since
8640 0.1.0
8641 #### Aliases
8642 *_.prototype.toJSON, _.prototype.valueOf*
8643
8644 #### Returns
8645 *(&#42;)*: Returns the resolved unwrapped value.
8646
8647 #### Example
8648 ```js
8649 _([1, 2, 3]).value();
8650 // => [1, 2, 3]
8651 ```
8652 * * *
8653
8654 <!-- /div -->
8655
8656 <!-- /div -->
8657
8658 <!-- div -->
8659
8660 ## `“String” Methods`
8661
8662 <!-- div -->
8663
8664 ### <a id="_camelcasestring"></a>`_.camelCase([string=''])`
8665 <a href="#_camelcasestring">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L13297 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.camelcase "See the npm package")
8666
8667 Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).
8668
8669 #### Since
8670 3.0.0
8671 #### Arguments
8672 1. `[string='']` *(string)*: The string to convert.
8673
8674 #### Returns
8675 *(string)*: Returns the camel cased string.
8676
8677 #### Example
8678 ```js
8679 _.camelCase('Foo Bar');
8680 // => 'fooBar'
8681
8682 _.camelCase('--foo-bar--');
8683 // => 'fooBar'
8684
8685 _.camelCase('__FOO_BAR__');
8686 // => 'fooBar'
8687 ```
8688 * * *
8689
8690 <!-- /div -->
8691
8692 <!-- div -->
8693
8694 ### <a id="_capitalizestring"></a>`_.capitalize([string=''])`
8695 <a href="#_capitalizestring">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L13317 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.capitalize "See the npm package")
8696
8697 Converts the first character of `string` to upper case and the remaining
8698 to lower case.
8699
8700 #### Since
8701 3.0.0
8702 #### Arguments
8703 1. `[string='']` *(string)*: The string to capitalize.
8704
8705 #### Returns
8706 *(string)*: Returns the capitalized string.
8707
8708 #### Example
8709 ```js
8710 _.capitalize('FRED');
8711 // => 'Fred'
8712 ```
8713 * * *
8714
8715 <!-- /div -->
8716
8717 <!-- div -->
8718
8719 ### <a id="_deburrstring"></a>`_.deburr([string=''])`
8720 <a href="#_deburrstring">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L13338 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.deburr "See the npm package")
8721
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).
8726
8727 #### Since
8728 3.0.0
8729 #### Arguments
8730 1. `[string='']` *(string)*: The string to deburr.
8731
8732 #### Returns
8733 *(string)*: Returns the deburred string.
8734
8735 #### Example
8736 ```js
8737 _.deburr('déjà vu');
8738 // => 'deja vu'
8739 ```
8740 * * *
8741
8742 <!-- /div -->
8743
8744 <!-- div -->
8745
8746 ### <a id="_endswithstring-target-positionstringlength"></a>`_.endsWith([string=''], [target], [position=string.length])`
8747 <a href="#_endswithstring-target-positionstringlength">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L13366 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.endswith "See the npm package")
8748
8749 Checks if `string` ends with the given target string.
8750
8751 #### Since
8752 3.0.0
8753 #### Arguments
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.
8757
8758 #### Returns
8759 *(boolean)*: Returns `true` if `string` ends with `target`, else `false`.
8760
8761 #### Example
8762 ```js
8763 _.endsWith('abc', 'c');
8764 // => true
8765
8766 _.endsWith('abc', 'b');
8767 // => false
8768
8769 _.endsWith('abc', 'b', 2);
8770 // => true
8771 ```
8772 * * *
8773
8774 <!-- /div -->
8775
8776 <!-- div -->
8777
8778 ### <a id="_escapestring"></a>`_.escape([string=''])`
8779 <a href="#_escapestring">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L13413 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.escape "See the npm package")
8780
8781 Converts the characters "&", "<", ">", '"', "'", and "\`" in `string` to
8782 their corresponding HTML entities.
8783 <br>
8784 <br>
8785 **Note:** No other characters are escaped. To escape additional
8786 characters use a third-party library like [_he_](https://mths.be/he).
8787 <br>
8788 <br>
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.
8794 <br>
8795 <br>
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.
8801 <br>
8802 <br>
8803 When working with HTML you should always
8804 [quote attribute values](http://wonko.com/post/html-escaping) to reduce
8805 XSS vectors.
8806
8807 #### Since
8808 0.1.0
8809 #### Arguments
8810 1. `[string='']` *(string)*: The string to escape.
8811
8812 #### Returns
8813 *(string)*: Returns the escaped string.
8814
8815 #### Example
8816 ```js
8817 _.escape('fred, barney, & pebbles');
8818 // => 'fred, barney, &amp; pebbles'
8819 ```
8820 * * *
8821
8822 <!-- /div -->
8823
8824 <!-- div -->
8825
8826 ### <a id="_escaperegexpstring"></a>`_.escapeRegExp([string=''])`
8827 <a href="#_escaperegexpstring">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L13435 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.escaperegexp "See the npm package")
8828
8829 Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+",
8830 "?", "(", ")", "[", "]", "{", "}", and "|" in `string`.
8831
8832 #### Since
8833 3.0.0
8834 #### Arguments
8835 1. `[string='']` *(string)*: The string to escape.
8836
8837 #### Returns
8838 *(string)*: Returns the escaped string.
8839
8840 #### Example
8841 ```js
8842 _.escapeRegExp('[lodash](https://lodash.com/)');
8843 // => '\[lodash\]\(https://lodash\.com/\)'
8844 ```
8845 * * *
8846
8847 <!-- /div -->
8848
8849 <!-- div -->
8850
8851 ### <a id="_kebabcasestring"></a>`_.kebabCase([string=''])`
8852 <a href="#_kebabcasestring">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L13463 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.kebabcase "See the npm package")
8853
8854 Converts `string` to
8855 [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).
8856
8857 #### Since
8858 3.0.0
8859 #### Arguments
8860 1. `[string='']` *(string)*: The string to convert.
8861
8862 #### Returns
8863 *(string)*: Returns the kebab cased string.
8864
8865 #### Example
8866 ```js
8867 _.kebabCase('Foo Bar');
8868 // => 'foo-bar'
8869
8870 _.kebabCase('fooBar');
8871 // => 'foo-bar'
8872
8873 _.kebabCase('__FOO_BAR__');
8874 // => 'foo-bar'
8875 ```
8876 * * *
8877
8878 <!-- /div -->
8879
8880 <!-- div -->
8881
8882 ### <a id="_lowercasestring"></a>`_.lowerCase([string=''])`
8883 <a href="#_lowercasestring">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L13487 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.lowercase "See the npm package")
8884
8885 Converts `string`, as space separated words, to lower case.
8886
8887 #### Since
8888 4.0.0
8889 #### Arguments
8890 1. `[string='']` *(string)*: The string to convert.
8891
8892 #### Returns
8893 *(string)*: Returns the lower cased string.
8894
8895 #### Example
8896 ```js
8897 _.lowerCase('--Foo-Bar--');
8898 // => 'foo bar'
8899
8900 _.lowerCase('fooBar');
8901 // => 'foo bar'
8902
8903 _.lowerCase('__FOO_BAR__');
8904 // => 'foo bar'
8905 ```
8906 * * *
8907
8908 <!-- /div -->
8909
8910 <!-- div -->
8911
8912 ### <a id="_lowerfirststring"></a>`_.lowerFirst([string=''])`
8913 <a href="#_lowerfirststring">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L13508 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.lowerfirst "See the npm package")
8914
8915 Converts the first character of `string` to lower case.
8916
8917 #### Since
8918 4.0.0
8919 #### Arguments
8920 1. `[string='']` *(string)*: The string to convert.
8921
8922 #### Returns
8923 *(string)*: Returns the converted string.
8924
8925 #### Example
8926 ```js
8927 _.lowerFirst('Fred');
8928 // => 'fred'
8929
8930 _.lowerFirst('FRED');
8931 // => 'fRED'
8932 ```
8933 * * *
8934
8935 <!-- /div -->
8936
8937 <!-- div -->
8938
8939 ### <a id="_padstring-length0-chars"></a>`_.pad([string=''], [length=0], [chars=' '])`
8940 <a href="#_padstring-length0-chars">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L13533 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.pad "See the npm package")
8941
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`.
8944
8945 #### Since
8946 3.0.0
8947 #### Arguments
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.
8951
8952 #### Returns
8953 *(string)*: Returns the padded string.
8954
8955 #### Example
8956 ```js
8957 _.pad('abc', 8);
8958 // => '  abc   '
8959
8960 _.pad('abc', 8, '_-');
8961 // => '_-abc_-_'
8962
8963 _.pad('abc', 3);
8964 // => 'abc'
8965 ```
8966 * * *
8967
8968 <!-- /div -->
8969
8970 <!-- div -->
8971
8972 ### <a id="_padendstring-length0-chars"></a>`_.padEnd([string=''], [length=0], [chars=' '])`
8973 <a href="#_padendstring-length0-chars">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L13572 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.padend "See the npm package")
8974
8975 Pads `string` on the right side if it's shorter than `length`. Padding
8976 characters are truncated if they exceed `length`.
8977
8978 #### Since
8979 4.0.0
8980 #### Arguments
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.
8984
8985 #### Returns
8986 *(string)*: Returns the padded string.
8987
8988 #### Example
8989 ```js
8990 _.padEnd('abc', 6);
8991 // => 'abc   '
8992
8993 _.padEnd('abc', 6, '_-');
8994 // => 'abc_-_'
8995
8996 _.padEnd('abc', 3);
8997 // => 'abc'
8998 ```
8999 * * *
9000
9001 <!-- /div -->
9002
9003 <!-- div -->
9004
9005 ### <a id="_padstartstring-length0-chars"></a>`_.padStart([string=''], [length=0], [chars=' '])`
9006 <a href="#_padstartstring-length0-chars">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L13605 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.padstart "See the npm package")
9007
9008 Pads `string` on the left side if it's shorter than `length`. Padding
9009 characters are truncated if they exceed `length`.
9010
9011 #### Since
9012 4.0.0
9013 #### Arguments
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.
9017
9018 #### Returns
9019 *(string)*: Returns the padded string.
9020
9021 #### Example
9022 ```js
9023 _.padStart('abc', 6);
9024 // => '   abc'
9025
9026 _.padStart('abc', 6, '_-');
9027 // => '_-_abc'
9028
9029 _.padStart('abc', 3);
9030 // => 'abc'
9031 ```
9032 * * *
9033
9034 <!-- /div -->
9035
9036 <!-- div -->
9037
9038 ### <a id="_parseintstring-radix10"></a>`_.parseInt(string, [radix=10])`
9039 <a href="#_parseintstring-radix10">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L13639 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.parseint "See the npm package")
9040
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.
9044 <br>
9045 <br>
9046 **Note:** This method aligns with the
9047 [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`.
9048
9049 #### Since
9050 1.1.0
9051 #### Arguments
9052 1. `string` *(string)*: The string to convert.
9053 2. `[radix=10]` *(number)*: The radix to interpret `value` by.
9054
9055 #### Returns
9056 *(number)*: Returns the converted integer.
9057
9058 #### Example
9059 ```js
9060 _.parseInt('08');
9061 // => 8
9062
9063 _.map(['6', '08', '10'], _.parseInt);
9064 // => [6, 8, 10]
9065 ```
9066 * * *
9067
9068 <!-- /div -->
9069
9070 <!-- div -->
9071
9072 ### <a id="_repeatstring-n1"></a>`_.repeat([string=''], [n=1])`
9073 <a href="#_repeatstring-n1">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L13673 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.repeat "See the npm package")
9074
9075 Repeats the given string `n` times.
9076
9077 #### Since
9078 3.0.0
9079 #### Arguments
9080 1. `[string='']` *(string)*: The string to repeat.
9081 2. `[n=1]` *(number)*: The number of times to repeat the string.
9082
9083 #### Returns
9084 *(string)*: Returns the repeated string.
9085
9086 #### Example
9087 ```js
9088 _.repeat('*', 3);
9089 // => '***'
9090
9091 _.repeat('abc', 2);
9092 // => 'abcabc'
9093
9094 _.repeat('abc', 0);
9095 // => ''
9096 ```
9097 * * *
9098
9099 <!-- /div -->
9100
9101 <!-- div -->
9102
9103 ### <a id="_replacestring-pattern-replacement"></a>`_.replace([string=''], pattern, replacement)`
9104 <a href="#_replacestring-pattern-replacement">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L13701 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.replace "See the npm package")
9105
9106 Replaces matches for `pattern` in `string` with `replacement`.
9107 <br>
9108 <br>
9109 **Note:** This method is based on
9110 [`String#replace`](https://mdn.io/String/replace).
9111
9112 #### Since
9113 4.0.0
9114 #### Arguments
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.
9118
9119 #### Returns
9120 *(string)*: Returns the modified string.
9121
9122 #### Example
9123 ```js
9124 _.replace('Hi Fred', 'Fred', 'Barney');
9125 // => 'Hi Barney'
9126 ```
9127 * * *
9128
9129 <!-- /div -->
9130
9131 <!-- div -->
9132
9133 ### <a id="_snakecasestring"></a>`_.snakeCase([string=''])`
9134 <a href="#_snakecasestring">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L13729 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.snakecase "See the npm package")
9135
9136 Converts `string` to
9137 [snake case](https://en.wikipedia.org/wiki/Snake_case).
9138
9139 #### Since
9140 3.0.0
9141 #### Arguments
9142 1. `[string='']` *(string)*: The string to convert.
9143
9144 #### Returns
9145 *(string)*: Returns the snake cased string.
9146
9147 #### Example
9148 ```js
9149 _.snakeCase('Foo Bar');
9150 // => 'foo_bar'
9151
9152 _.snakeCase('fooBar');
9153 // => 'foo_bar'
9154
9155 _.snakeCase('--FOO-BAR--');
9156 // => 'foo_bar'
9157 ```
9158 * * *
9159
9160 <!-- /div -->
9161
9162 <!-- div -->
9163
9164 ### <a id="_splitstring-separator-limit"></a>`_.split([string=''], separator, [limit])`
9165 <a href="#_splitstring-separator-limit">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L13752 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.split "See the npm package")
9166
9167 Splits `string` by `separator`.
9168 <br>
9169 <br>
9170 **Note:** This method is based on
9171 [`String#split`](https://mdn.io/String/split).
9172
9173 #### Since
9174 4.0.0
9175 #### Arguments
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.
9179
9180 #### Returns
9181 *(Array)*: Returns the new array of string segments.
9182
9183 #### Example
9184 ```js
9185 _.split('a-b-c', '-', 2);
9186 // => ['a', 'b']
9187 ```
9188 * * *
9189
9190 <!-- /div -->
9191
9192 <!-- div -->
9193
9194 ### <a id="_startcasestring"></a>`_.startCase([string=''])`
9195 <a href="#_startcasestring">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L13794 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.startcase "See the npm package")
9196
9197 Converts `string` to
9198 [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).
9199
9200 #### Since
9201 3.1.0
9202 #### Arguments
9203 1. `[string='']` *(string)*: The string to convert.
9204
9205 #### Returns
9206 *(string)*: Returns the start cased string.
9207
9208 #### Example
9209 ```js
9210 _.startCase('--foo-bar--');
9211 // => 'Foo Bar'
9212
9213 _.startCase('fooBar');
9214 // => 'Foo Bar'
9215
9216 _.startCase('__FOO_BAR__');
9217 // => 'FOO BAR'
9218 ```
9219 * * *
9220
9221 <!-- /div -->
9222
9223 <!-- div -->
9224
9225 ### <a id="_startswithstring-target-position0"></a>`_.startsWith([string=''], [target], [position=0])`
9226 <a href="#_startswithstring-target-position0">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L13821 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.startswith "See the npm package")
9227
9228 Checks if `string` starts with the given target string.
9229
9230 #### Since
9231 3.0.0
9232 #### Arguments
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.
9236
9237 #### Returns
9238 *(boolean)*: Returns `true` if `string` starts with `target`, else `false`.
9239
9240 #### Example
9241 ```js
9242 _.startsWith('abc', 'a');
9243 // => true
9244
9245 _.startsWith('abc', 'b');
9246 // => false
9247
9248 _.startsWith('abc', 'b', 1);
9249 // => true
9250 ```
9251 * * *
9252
9253 <!-- /div -->
9254
9255 <!-- div -->
9256
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> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L13930 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.template "See the npm package")
9259
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.
9265 <br>
9266 <br>
9267 **Note:** In the development build `_.template` utilizes
9268 [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)
9269 for easier debugging.
9270 <br>
9271 <br>
9272 For more information on precompiling templates see
9273 [lodash's custom builds documentation](https://lodash.com/custom-builds).
9274 <br>
9275 <br>
9276 For more information on Chrome extension sandboxes see
9277 [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).
9278
9279 #### Since
9280 0.1.0
9281 #### Arguments
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.
9290
9291 #### Returns
9292 *(Function)*: Returns the compiled template function.
9293
9294 #### Example
9295 ```js
9296 // Use the "interpolate" delimiter to create a compiled template.
9297 var compiled = _.template('hello <%= user %>!');
9298 compiled({ 'user': 'fred' });
9299 // => 'hello fred!'
9300
9301 // Use the HTML "escape" delimiter to escape data property values.
9302 var compiled = _.template('<b><%- value %></b>');
9303 compiled({ 'value': '<script>' });
9304 // => '<b>&lt;script&gt;</b>'
9305
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>'
9310
9311 // Use the internal `print` function in "evaluate" delimiters.
9312 var compiled = _.template('<% print("hello " + user); %>!');
9313 compiled({ 'user': 'barney' });
9314 // => 'hello barney!'
9315
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!'
9320
9321 // Use custom template delimiters.
9322 _.templateSettings.interpolate = /{{([\s\S]+?)}}/g;
9323 var compiled = _.template('hello {{ user }}!');
9324 compiled({ 'user': 'mustache' });
9325 // => 'hello mustache!'
9326
9327 // Use backslashes to treat delimiters as plain text.
9328 var compiled = _.template('<%= "\\<%- value %\\>" %>');
9329 compiled({ 'value': 'ignored' });
9330 // => '<%- value %>'
9331
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>'
9337
9338 // Use the `sourceURL` option to specify a custom sourceURL for the template.
9339 var compiled = _.template('hello <%= user %>!', { 'sourceURL': '/basic/greeting.jst' });
9340 compiled(data);
9341 // => Find the source of "greeting.jst" under the Sources tab or Resources panel of the web inspector.
9342
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' });
9345 compiled.source;
9346 // => function(data) {
9347 //   var __t, __p = '';
9348 //   __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!';
9349 //   return __p;
9350 // }
9351
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'), '\
9355   var JST = {\
9356     "main": ' + _.template(mainText).source + '\
9357   };\
9358 ');
9359 ```
9360 * * *
9361
9362 <!-- /div -->
9363
9364 <!-- div -->
9365
9366 ### <a id="_tolowerstring"></a>`_.toLower([string=''])`
9367 <a href="#_tolowerstring">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L14059 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.tolower "See the npm package")
9368
9369 Converts `string`, as a whole, to lower case just like
9370 [String#toLowerCase](https://mdn.io/toLowerCase).
9371
9372 #### Since
9373 4.0.0
9374 #### Arguments
9375 1. `[string='']` *(string)*: The string to convert.
9376
9377 #### Returns
9378 *(string)*: Returns the lower cased string.
9379
9380 #### Example
9381 ```js
9382 _.toLower('--Foo-Bar--');
9383 // => '--foo-bar--'
9384
9385 _.toLower('fooBar');
9386 // => 'foobar'
9387
9388 _.toLower('__FOO_BAR__');
9389 // => '__foo_bar__'
9390 ```
9391 * * *
9392
9393 <!-- /div -->
9394
9395 <!-- div -->
9396
9397 ### <a id="_toupperstring"></a>`_.toUpper([string=''])`
9398 <a href="#_toupperstring">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L14084 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.toupper "See the npm package")
9399
9400 Converts `string`, as a whole, to upper case just like
9401 [String#toUpperCase](https://mdn.io/toUpperCase).
9402
9403 #### Since
9404 4.0.0
9405 #### Arguments
9406 1. `[string='']` *(string)*: The string to convert.
9407
9408 #### Returns
9409 *(string)*: Returns the upper cased string.
9410
9411 #### Example
9412 ```js
9413 _.toUpper('--foo-bar--');
9414 // => '--FOO-BAR--'
9415
9416 _.toUpper('fooBar');
9417 // => 'FOOBAR'
9418
9419 _.toUpper('__foo_bar__');
9420 // => '__FOO_BAR__'
9421 ```
9422 * * *
9423
9424 <!-- /div -->
9425
9426 <!-- div -->
9427
9428 ### <a id="_trimstring-charswhitespace"></a>`_.trim([string=''], [chars=whitespace])`
9429 <a href="#_trimstring-charswhitespace">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L14110 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.trim "See the npm package")
9430
9431 Removes leading and trailing whitespace or specified characters from `string`.
9432
9433 #### Since
9434 3.0.0
9435 #### Arguments
9436 1. `[string='']` *(string)*: The string to trim.
9437 2. `[chars=whitespace]` *(string)*: The characters to trim.
9438
9439 #### Returns
9440 *(string)*: Returns the trimmed string.
9441
9442 #### Example
9443 ```js
9444 _.trim('  abc  ');
9445 // => 'abc'
9446
9447 _.trim('-_-abc-_-', '_-');
9448 // => 'abc'
9449
9450 _.map(['  foo  ', '  bar  '], _.trim);
9451 // => ['foo', 'bar']
9452 ```
9453 * * *
9454
9455 <!-- /div -->
9456
9457 <!-- div -->
9458
9459 ### <a id="_trimendstring-charswhitespace"></a>`_.trimEnd([string=''], [chars=whitespace])`
9460 <a href="#_trimendstring-charswhitespace">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L14145 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.trimend "See the npm package")
9461
9462 Removes trailing whitespace or specified characters from `string`.
9463
9464 #### Since
9465 4.0.0
9466 #### Arguments
9467 1. `[string='']` *(string)*: The string to trim.
9468 2. `[chars=whitespace]` *(string)*: The characters to trim.
9469
9470 #### Returns
9471 *(string)*: Returns the trimmed string.
9472
9473 #### Example
9474 ```js
9475 _.trimEnd('  abc  ');
9476 // => '  abc'
9477
9478 _.trimEnd('-_-abc-_-', '_-');
9479 // => '-_-abc'
9480 ```
9481 * * *
9482
9483 <!-- /div -->
9484
9485 <!-- div -->
9486
9487 ### <a id="_trimstartstring-charswhitespace"></a>`_.trimStart([string=''], [chars=whitespace])`
9488 <a href="#_trimstartstring-charswhitespace">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L14178 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.trimstart "See the npm package")
9489
9490 Removes leading whitespace or specified characters from `string`.
9491
9492 #### Since
9493 4.0.0
9494 #### Arguments
9495 1. `[string='']` *(string)*: The string to trim.
9496 2. `[chars=whitespace]` *(string)*: The characters to trim.
9497
9498 #### Returns
9499 *(string)*: Returns the trimmed string.
9500
9501 #### Example
9502 ```js
9503 _.trimStart('  abc  ');
9504 // => 'abc  '
9505
9506 _.trimStart('-_-abc-_-', '_-');
9507 // => 'abc-_-'
9508 ```
9509 * * *
9510
9511 <!-- /div -->
9512
9513 <!-- div -->
9514
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> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L14229 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.truncate "See the npm package")
9517
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 "...".
9521
9522 #### Since
9523 4.0.0
9524 #### Arguments
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.
9530
9531 #### Returns
9532 *(string)*: Returns the truncated string.
9533
9534 #### Example
9535 ```js
9536 _.truncate('hi-diddly-ho there, neighborino');
9537 // => 'hi-diddly-ho there, neighbo...'
9538
9539 _.truncate('hi-diddly-ho there, neighborino', {
9540   'length': 24,
9541   'separator': ' '
9542 });
9543 // => 'hi-diddly-ho there,...'
9544
9545 _.truncate('hi-diddly-ho there, neighborino', {
9546   'length': 24,
9547   'separator': /,? +/
9548 });
9549 // => 'hi-diddly-ho there...'
9550
9551 _.truncate('hi-diddly-ho there, neighborino', {
9552   'omission': ' [...]'
9553 });
9554 // => 'hi-diddly-ho there, neig [...]'
9555 ```
9556 * * *
9557
9558 <!-- /div -->
9559
9560 <!-- div -->
9561
9562 ### <a id="_unescapestring"></a>`_.unescape([string=''])`
9563 <a href="#_unescapestring">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L14304 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.unescape "See the npm package")
9564
9565 The inverse of `_.escape`; this method converts the HTML entities
9566 `&amp;`, `&lt;`, `&gt;`, `&quot;`, `&#39;`, and `&#96;` in `string` to
9567 their corresponding characters.
9568 <br>
9569 <br>
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).
9572
9573 #### Since
9574 0.6.0
9575 #### Arguments
9576 1. `[string='']` *(string)*: The string to unescape.
9577
9578 #### Returns
9579 *(string)*: Returns the unescaped string.
9580
9581 #### Example
9582 ```js
9583 _.unescape('fred, barney, &amp; pebbles');
9584 // => 'fred, barney, & pebbles'
9585 ```
9586 * * *
9587
9588 <!-- /div -->
9589
9590 <!-- div -->
9591
9592 ### <a id="_uppercasestring"></a>`_.upperCase([string=''])`
9593 <a href="#_uppercasestring">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L14331 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.uppercase "See the npm package")
9594
9595 Converts `string`, as space separated words, to upper case.
9596
9597 #### Since
9598 4.0.0
9599 #### Arguments
9600 1. `[string='']` *(string)*: The string to convert.
9601
9602 #### Returns
9603 *(string)*: Returns the upper cased string.
9604
9605 #### Example
9606 ```js
9607 _.upperCase('--foo-bar');
9608 // => 'FOO BAR'
9609
9610 _.upperCase('fooBar');
9611 // => 'FOO BAR'
9612
9613 _.upperCase('__foo_bar__');
9614 // => 'FOO BAR'
9615 ```
9616 * * *
9617
9618 <!-- /div -->
9619
9620 <!-- div -->
9621
9622 ### <a id="_upperfirststring"></a>`_.upperFirst([string=''])`
9623 <a href="#_upperfirststring">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L14352 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.upperfirst "See the npm package")
9624
9625 Converts the first character of `string` to upper case.
9626
9627 #### Since
9628 4.0.0
9629 #### Arguments
9630 1. `[string='']` *(string)*: The string to convert.
9631
9632 #### Returns
9633 *(string)*: Returns the converted string.
9634
9635 #### Example
9636 ```js
9637 _.upperFirst('fred');
9638 // => 'Fred'
9639
9640 _.upperFirst('FRED');
9641 // => 'FRED'
9642 ```
9643 * * *
9644
9645 <!-- /div -->
9646
9647 <!-- div -->
9648
9649 ### <a id="_wordsstring-pattern"></a>`_.words([string=''], [pattern])`
9650 <a href="#_wordsstring-pattern">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L14373 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.words "See the npm package")
9651
9652 Splits `string` into an array of its words.
9653
9654 #### Since
9655 3.0.0
9656 #### Arguments
9657 1. `[string='']` *(string)*: The string to inspect.
9658 2. `[pattern]` *(RegExp|string)*: The pattern to match words.
9659
9660 #### Returns
9661 *(Array)*: Returns the words of `string`.
9662
9663 #### Example
9664 ```js
9665 _.words('fred, barney, & pebbles');
9666 // => ['fred', 'barney', 'pebbles']
9667
9668 _.words('fred, barney, & pebbles', /[^, ]+/g);
9669 // => ['fred', 'barney', '&', 'pebbles']
9670 ```
9671 * * *
9672
9673 <!-- /div -->
9674
9675 <!-- /div -->
9676
9677 <!-- div -->
9678
9679 ## `“Util” Methods`
9680
9681 <!-- div -->
9682
9683 ### <a id="_attemptfunc-args"></a>`_.attempt(func, [args])`
9684 <a href="#_attemptfunc-args">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L14407 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.attempt "See the npm package")
9685
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.
9688
9689 #### Since
9690 3.0.0
9691 #### Arguments
9692 1. `func` *(Function)*: The function to attempt.
9693 2. `[args]` *(...&#42;)*: The arguments to invoke `func` with.
9694
9695 #### Returns
9696 *(&#42;)*: Returns the `func` result or error object.
9697
9698 #### Example
9699 ```js
9700 // Avoid throwing errors for invalid selectors.
9701 var elements = _.attempt(function(selector) {
9702   return document.querySelectorAll(selector);
9703 }, '>_>');
9704
9705 if (_.isError(elements)) {
9706   elements = [];
9707 }
9708 ```
9709 * * *
9710
9711 <!-- /div -->
9712
9713 <!-- div -->
9714
9715 ### <a id="_bindallobject-methodnames"></a>`_.bindAll(object, methodNames)`
9716 <a href="#_bindallobject-methodnames">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L14441 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.bindall "See the npm package")
9717
9718 Binds methods of an object to the object itself, overwriting the existing
9719 method.
9720 <br>
9721 <br>
9722 **Note:** This method doesn't set the "length" property of bound functions.
9723
9724 #### Since
9725 0.1.0
9726 #### Arguments
9727 1. `object` *(Object)*: The object to bind and assign the bound methods to.
9728 2. `methodNames` *(...(string|string&#91;&#93;))*: The object method names to bind.
9729
9730 #### Returns
9731 *(Object)*: Returns `object`.
9732
9733 #### Example
9734 ```js
9735 var view = {
9736   'label': 'docs',
9737   'onClick': function() {
9738     console.log('clicked ' + this.label);
9739   }
9740 };
9741
9742 _.bindAll(view, 'onClick');
9743 jQuery(element).on('click', view.onClick);
9744 // => Logs 'clicked docs' when clicked.
9745 ```
9746 * * *
9747
9748 <!-- /div -->
9749
9750 <!-- div -->
9751
9752 ### <a id="_condpairs"></a>`_.cond(pairs)`
9753 <a href="#_condpairs">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L14478 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.cond "See the npm package")
9754
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
9758 function.
9759
9760 #### Since
9761 4.0.0
9762 #### Arguments
9763 1. `pairs` *(Array)*: The predicate-function pairs.
9764
9765 #### Returns
9766 *(Function)*: Returns the new function.
9767
9768 #### Example
9769 ```js
9770 var func = _.cond([
9771   [_.matches({ 'a': 1 }),           _.constant('matches A')],
9772   [_.conforms({ 'b': _.isNumber }), _.constant('matches B')],
9773   [_.constant(true),                _.constant('no match')]
9774 ]);
9775
9776 func({ 'a': 1, 'b': 2 });
9777 // => 'matches A'
9778
9779 func({ 'a': 0, 'b': 1 });
9780 // => 'matches B'
9781
9782 func({ 'a': '1', 'b': '2' });
9783 // => 'no match'
9784 ```
9785 * * *
9786
9787 <!-- /div -->
9788
9789 <!-- div -->
9790
9791 ### <a id="_conformssource"></a>`_.conforms(source)`
9792 <a href="#_conformssource">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L14521 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.conforms "See the npm package")
9793
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`.
9797
9798 #### Since
9799 4.0.0
9800 #### Arguments
9801 1. `source` *(Object)*: The object of property predicates to conform to.
9802
9803 #### Returns
9804 *(Function)*: Returns the new function.
9805
9806 #### Example
9807 ```js
9808 var users = [
9809   { 'user': 'barney', 'age': 36 },
9810   { 'user': 'fred',   'age': 40 }
9811 ];
9812
9813 _.filter(users, _.conforms({ 'age': _.partial(_.gt, _, 38) }));
9814 // => [{ 'user': 'fred', 'age': 40 }]
9815 ```
9816 * * *
9817
9818 <!-- /div -->
9819
9820 <!-- div -->
9821
9822 ### <a id="_constantvalue"></a>`_.constant(value)`
9823 <a href="#_constantvalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L14542 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.constant "See the npm package")
9824
9825 Creates a function that returns `value`.
9826
9827 #### Since
9828 2.4.0
9829 #### Arguments
9830 1. `value` *(&#42;)*: The value to return from the new function.
9831
9832 #### Returns
9833 *(Function)*: Returns the new function.
9834
9835 #### Example
9836 ```js
9837 var object = { 'user': 'fred' };
9838 var getter = _.constant(object);
9839
9840 getter() === object;
9841 // => true
9842 ```
9843 * * *
9844
9845 <!-- /div -->
9846
9847 <!-- div -->
9848
9849 ### <a id="_flowfuncs"></a>`_.flow([funcs])`
9850 <a href="#_flowfuncs">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L14570 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.flow "See the npm package")
9851
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.
9855
9856 #### Since
9857 3.0.0
9858 #### Arguments
9859 1. `[funcs]` *(...(Function|Function&#91;&#93;))*: Functions to invoke.
9860
9861 #### Returns
9862 *(Function)*: Returns the new function.
9863
9864 #### Example
9865 ```js
9866 function square(n) {
9867   return n * n;
9868 }
9869
9870 var addSquare = _.flow(_.add, square);
9871 addSquare(1, 2);
9872 // => 9
9873 ```
9874 * * *
9875
9876 <!-- /div -->
9877
9878 <!-- div -->
9879
9880 ### <a id="_flowrightfuncs"></a>`_.flowRight([funcs])`
9881 <a href="#_flowrightfuncs">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L14593 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.flowright "See the npm package")
9882
9883 This method is like `_.flow` except that it creates a function that
9884 invokes the given functions from right to left.
9885
9886 #### Since
9887 3.0.0
9888 #### Arguments
9889 1. `[funcs]` *(...(Function|Function&#91;&#93;))*: Functions to invoke.
9890
9891 #### Returns
9892 *(Function)*: Returns the new function.
9893
9894 #### Example
9895 ```js
9896 function square(n) {
9897   return n * n;
9898 }
9899
9900 var addSquare = _.flowRight(square, _.add);
9901 addSquare(1, 2);
9902 // => 9
9903 ```
9904 * * *
9905
9906 <!-- /div -->
9907
9908 <!-- div -->
9909
9910 ### <a id="_identityvalue"></a>`_.identity(value)`
9911 <a href="#_identityvalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L14611 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.identity "See the npm package")
9912
9913 This method returns the first argument given to it.
9914
9915 #### Since
9916 0.1.0
9917 #### Arguments
9918 1. `value` *(&#42;)*: Any value.
9919
9920 #### Returns
9921 *(&#42;)*: Returns `value`.
9922
9923 #### Example
9924 ```js
9925 var object = { 'user': 'fred' };
9926
9927 _.identity(object) === object;
9928 // => true
9929 ```
9930 * * *
9931
9932 <!-- /div -->
9933
9934 <!-- div -->
9935
9936 ### <a id="_iterateefunc_identity"></a>`_.iteratee([func=_.identity])`
9937 <a href="#_iterateefunc_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L14657 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.iteratee "See the npm package")
9938
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`.
9944
9945 #### Since
9946 4.0.0
9947 #### Arguments
9948 1. `[func=_.identity]` *(&#42;)*: The value to convert to a callback.
9949
9950 #### Returns
9951 *(Function)*: Returns the callback.
9952
9953 #### Example
9954 ```js
9955 var users = [
9956   { 'user': 'barney', 'age': 36, 'active': true },
9957   { 'user': 'fred',   'age': 40, 'active': false }
9958 ];
9959
9960 // The `_.matches` iteratee shorthand.
9961 _.filter(users, _.iteratee({ 'user': 'barney', 'active': true }));
9962 // => [{ 'user': 'barney', 'age': 36, 'active': true }]
9963
9964 // The `_.matchesProperty` iteratee shorthand.
9965 _.filter(users, _.iteratee(['user', 'fred']));
9966 // => [{ 'user': 'fred', 'age': 40 }]
9967
9968 // The `_.property` iteratee shorthand.
9969 _.map(users, _.iteratee('user'));
9970 // => ['barney', 'fred']
9971
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);
9976   };
9977 });
9978
9979 _.filter(['abc', 'def'], /ef/);
9980 // => ['def']
9981 ```
9982 * * *
9983
9984 <!-- /div -->
9985
9986 <!-- div -->
9987
9988 ### <a id="_matchessource"></a>`_.matches(source)`
9989 <a href="#_matchessource">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L14685 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.matches "See the npm package")
9990
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.
9995 <br>
9996 <br>
9997 **Note:** This method supports comparing the same values as `_.isEqual`.
9998
9999 #### Since
10000 3.0.0
10001 #### Arguments
10002 1. `source` *(Object)*: The object of property values to match.
10003
10004 #### Returns
10005 *(Function)*: Returns the new function.
10006
10007 #### Example
10008 ```js
10009 var users = [
10010   { 'user': 'barney', 'age': 36, 'active': true },
10011   { 'user': 'fred',   'age': 40, 'active': false }
10012 ];
10013
10014 _.filter(users, _.matches({ 'age': 40, 'active': false }));
10015 // => [{ 'user': 'fred', 'age': 40, 'active': false }]
10016 ```
10017 * * *
10018
10019 <!-- /div -->
10020
10021 <!-- div -->
10022
10023 ### <a id="_matchespropertypath-srcvalue"></a>`_.matchesProperty(path, srcValue)`
10024 <a href="#_matchespropertypath-srcvalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L14713 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.matchesproperty "See the npm package")
10025
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`.
10029 <br>
10030 <br>
10031 **Note:** This method supports comparing the same values as `_.isEqual`.
10032
10033 #### Since
10034 3.2.0
10035 #### Arguments
10036 1. `path` *(Array|string)*: The path of the property to get.
10037 2. `srcValue` *(&#42;)*: The value to match.
10038
10039 #### Returns
10040 *(Function)*: Returns the new function.
10041
10042 #### Example
10043 ```js
10044 var users = [
10045   { 'user': 'barney' },
10046   { 'user': 'fred' }
10047 ];
10048
10049 _.find(users, _.matchesProperty('user', 'fred'));
10050 // => { 'user': 'fred' }
10051 ```
10052 * * *
10053
10054 <!-- /div -->
10055
10056 <!-- div -->
10057
10058 ### <a id="_methodpath-args"></a>`_.method(path, [args])`
10059 <a href="#_methodpath-args">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L14741 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.method "See the npm package")
10060
10061 Creates a function that invokes the method at `path` of a given object.
10062 Any additional arguments are provided to the invoked method.
10063
10064 #### Since
10065 3.7.0
10066 #### Arguments
10067 1. `path` *(Array|string)*: The path of the method to invoke.
10068 2. `[args]` *(...&#42;)*: The arguments to invoke the method with.
10069
10070 #### Returns
10071 *(Function)*: Returns the new function.
10072
10073 #### Example
10074 ```js
10075 var objects = [
10076   { 'a': { 'b': _.constant(2) } },
10077   { 'a': { 'b': _.constant(1) } }
10078 ];
10079
10080 _.map(objects, _.method('a.b'));
10081 // => [2, 1]
10082
10083 _.map(objects, _.method(['a', 'b']));
10084 // => [2, 1]
10085 ```
10086 * * *
10087
10088 <!-- /div -->
10089
10090 <!-- div -->
10091
10092 ### <a id="_methodofobject-args"></a>`_.methodOf(object, [args])`
10093 <a href="#_methodofobject-args">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L14770 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.methodof "See the npm package")
10094
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.
10098
10099 #### Since
10100 3.7.0
10101 #### Arguments
10102 1. `object` *(Object)*: The object to query.
10103 2. `[args]` *(...&#42;)*: The arguments to invoke the method with.
10104
10105 #### Returns
10106 *(Function)*: Returns the new function.
10107
10108 #### Example
10109 ```js
10110 var array = _.times(3, _.constant),
10111     object = { 'a': array, 'b': array, 'c': array };
10112
10113 _.map(['a[2]', 'c[0]'], _.methodOf(object));
10114 // => [2, 0]
10115
10116 _.map([['a', '2'], ['c', '0']], _.methodOf(object));
10117 // => [2, 0]
10118 ```
10119 * * *
10120
10121 <!-- /div -->
10122
10123 <!-- div -->
10124
10125 ### <a id="_mixinobjectlodash-source-options-optionschaintrue"></a>`_.mixin([object=lodash], source, [options={}], [options.chain=true])`
10126 <a href="#_mixinobjectlodash-source-options-optionschaintrue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L14812 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.mixin "See the npm package")
10127
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.
10131 <br>
10132 <br>
10133 **Note:** Use `_.runInContext` to create a pristine `lodash` function to
10134 avoid conflicts caused by modifying the original.
10135
10136 #### Since
10137 0.1.0
10138 #### Arguments
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.
10143
10144 #### Returns
10145 *(&#42;)*: Returns `object`.
10146
10147 #### Example
10148 ```js
10149 function vowels(string) {
10150   return _.filter(string, function(v) {
10151     return /[aeiou]/i.test(v);
10152   });
10153 }
10154
10155 _.mixin({ 'vowels': vowels });
10156 _.vowels('fred');
10157 // => ['e']
10158
10159 _('fred').vowels().value();
10160 // => ['e']
10161
10162 _.mixin({ 'vowels': vowels }, { 'chain': false });
10163 _('fred').vowels();
10164 // => ['e']
10165 ```
10166 * * *
10167
10168 <!-- /div -->
10169
10170 <!-- div -->
10171
10172 ### <a id="_noconflict"></a>`_.noConflict()`
10173 <a href="#_noconflict">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L14861 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.noconflict "See the npm package")
10174
10175 Reverts the `_` variable to its previous value and returns a reference to
10176 the `lodash` function.
10177
10178 #### Since
10179 0.1.0
10180 #### Returns
10181 *(Function)*: Returns the `lodash` function.
10182
10183 #### Example
10184 ```js
10185 var lodash = _.noConflict();
10186 ```
10187 * * *
10188
10189 <!-- /div -->
10190
10191 <!-- div -->
10192
10193 ### <a id="_noop"></a>`_.noop()`
10194 <a href="#_noop">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L14883 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.noop "See the npm package")
10195
10196 A no-operation function that returns `undefined` regardless of the
10197 arguments it receives.
10198
10199 #### Since
10200 2.3.0
10201 #### Example
10202 ```js
10203 var object = { 'user': 'fred' };
10204
10205 _.noop(object) === undefined;
10206 // => true
10207 ```
10208 * * *
10209
10210 <!-- /div -->
10211
10212 <!-- div -->
10213
10214 ### <a id="_nthargn0"></a>`_.nthArg([n=0])`
10215 <a href="#_nthargn0">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L14907 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.ntharg "See the npm package")
10216
10217 Creates a function that returns its nth argument. If `n` is negative,
10218 the nth argument from the end is returned.
10219
10220 #### Since
10221 4.0.0
10222 #### Arguments
10223 1. `[n=0]` *(number)*: The index of the argument to return.
10224
10225 #### Returns
10226 *(Function)*: Returns the new function.
10227
10228 #### Example
10229 ```js
10230 var func = _.nthArg(1);
10231 func('a', 'b', 'c', 'd');
10232 // => 'b'
10233
10234 var func = _.nthArg(-2);
10235 func('a', 'b', 'c', 'd');
10236 // => 'c'
10237 ```
10238 * * *
10239
10240 <!-- /div -->
10241
10242 <!-- div -->
10243
10244 ### <a id="_overiteratees_identity"></a>`_.over([iteratees=[_.identity]])`
10245 <a href="#_overiteratees_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L14932 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.over "See the npm package")
10246
10247 Creates a function that invokes `iteratees` with the arguments it receives
10248 and returns their results.
10249
10250 #### Since
10251 4.0.0
10252 #### Arguments
10253 1. `[iteratees=[_.identity]]` *(...(Array|Array&#91;&#93;|Function|Function&#91;&#93;|Object|Object&#91;&#93;|string|string&#91;&#93;))*: The iteratees to invoke.
10254
10255 #### Returns
10256 *(Function)*: Returns the new function.
10257
10258 #### Example
10259 ```js
10260 var func = _.over(Math.max, Math.min);
10261
10262 func(1, 2, 3, 4);
10263 // => [4, 1]
10264 ```
10265 * * *
10266
10267 <!-- /div -->
10268
10269 <!-- div -->
10270
10271 ### <a id="_overeverypredicates_identity"></a>`_.overEvery([predicates=[_.identity]])`
10272 <a href="#_overeverypredicates_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L14958 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.overevery "See the npm package")
10273
10274 Creates a function that checks if **all** of the `predicates` return
10275 truthy when invoked with the arguments it receives.
10276
10277 #### Since
10278 4.0.0
10279 #### Arguments
10280 1. `[predicates=[_.identity]]` *(...(Array|Array&#91;&#93;|Function|Function&#91;&#93;|Object|Object&#91;&#93;|string|string&#91;&#93;))*: The predicates to check.
10281
10282 #### Returns
10283 *(Function)*: Returns the new function.
10284
10285 #### Example
10286 ```js
10287 var func = _.overEvery(Boolean, isFinite);
10288
10289 func('1');
10290 // => true
10291
10292 func(null);
10293 // => false
10294
10295 func(NaN);
10296 // => false
10297 ```
10298 * * *
10299
10300 <!-- /div -->
10301
10302 <!-- div -->
10303
10304 ### <a id="_oversomepredicates_identity"></a>`_.overSome([predicates=[_.identity]])`
10305 <a href="#_oversomepredicates_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L14984 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.oversome "See the npm package")
10306
10307 Creates a function that checks if **any** of the `predicates` return
10308 truthy when invoked with the arguments it receives.
10309
10310 #### Since
10311 4.0.0
10312 #### Arguments
10313 1. `[predicates=[_.identity]]` *(...(Array|Array&#91;&#93;|Function|Function&#91;&#93;|Object|Object&#91;&#93;|string|string&#91;&#93;))*: The predicates to check.
10314
10315 #### Returns
10316 *(Function)*: Returns the new function.
10317
10318 #### Example
10319 ```js
10320 var func = _.overSome(Boolean, isFinite);
10321
10322 func('1');
10323 // => true
10324
10325 func(null);
10326 // => true
10327
10328 func(NaN);
10329 // => false
10330 ```
10331 * * *
10332
10333 <!-- /div -->
10334
10335 <!-- div -->
10336
10337 ### <a id="_propertypath"></a>`_.property(path)`
10338 <a href="#_propertypath">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L15008 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.property "See the npm package")
10339
10340 Creates a function that returns the value at `path` of a given object.
10341
10342 #### Since
10343 2.4.0
10344 #### Arguments
10345 1. `path` *(Array|string)*: The path of the property to get.
10346
10347 #### Returns
10348 *(Function)*: Returns the new function.
10349
10350 #### Example
10351 ```js
10352 var objects = [
10353   { 'a': { 'b': 2 } },
10354   { 'a': { 'b': 1 } }
10355 ];
10356
10357 _.map(objects, _.property('a.b'));
10358 // => [2, 1]
10359
10360 _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
10361 // => [1, 2]
10362 ```
10363 * * *
10364
10365 <!-- /div -->
10366
10367 <!-- div -->
10368
10369 ### <a id="_propertyofobject"></a>`_.propertyOf(object)`
10370 <a href="#_propertyofobject">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L15033 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.propertyof "See the npm package")
10371
10372 The opposite of `_.property`; this method creates a function that returns
10373 the value at a given path of `object`.
10374
10375 #### Since
10376 3.0.0
10377 #### Arguments
10378 1. `object` *(Object)*: The object to query.
10379
10380 #### Returns
10381 *(Function)*: Returns the new function.
10382
10383 #### Example
10384 ```js
10385 var array = [0, 1, 2],
10386     object = { 'a': array, 'b': array, 'c': array };
10387
10388 _.map(['a[2]', 'c[0]'], _.propertyOf(object));
10389 // => [2, 0]
10390
10391 _.map([['a', '2'], ['c', '0']], _.propertyOf(object));
10392 // => [2, 0]
10393 ```
10394 * * *
10395
10396 <!-- /div -->
10397
10398 <!-- div -->
10399
10400 ### <a id="_rangestart0-end-step1"></a>`_.range([start=0], end, [step=1])`
10401 <a href="#_rangestart0-end-step1">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L15080 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.range "See the npm package")
10402
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`.
10407 <br>
10408 <br>
10409 **Note:** JavaScript follows the IEEE-754 standard for resolving
10410 floating-point values which can produce unexpected results.
10411
10412 #### Since
10413 0.1.0
10414 #### Arguments
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.
10418
10419 #### Returns
10420 *(Array)*: Returns the new array of numbers.
10421
10422 #### Example
10423 ```js
10424 _.range(4);
10425 // => [0, 1, 2, 3]
10426
10427 _.range(-4);
10428 // => [0, -1, -2, -3]
10429
10430 _.range(1, 5);
10431 // => [1, 2, 3, 4]
10432
10433 _.range(0, 20, 5);
10434 // => [0, 5, 10, 15]
10435
10436 _.range(0, -4, -1);
10437 // => [0, -1, -2, -3]
10438
10439 _.range(1, 4, 0);
10440 // => [1, 1, 1]
10441
10442 _.range(0);
10443 // => []
10444 ```
10445 * * *
10446
10447 <!-- /div -->
10448
10449 <!-- div -->
10450
10451 ### <a id="_rangerightstart0-end-step1"></a>`_.rangeRight([start=0], end, [step=1])`
10452 <a href="#_rangerightstart0-end-step1">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L15118 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.rangeright "See the npm package")
10453
10454 This method is like `_.range` except that it populates values in
10455 descending order.
10456
10457 #### Since
10458 4.0.0
10459 #### Arguments
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.
10463
10464 #### Returns
10465 *(Array)*: Returns the new array of numbers.
10466
10467 #### Example
10468 ```js
10469 _.rangeRight(4);
10470 // => [3, 2, 1, 0]
10471
10472 _.rangeRight(-4);
10473 // => [-3, -2, -1, 0]
10474
10475 _.rangeRight(1, 5);
10476 // => [4, 3, 2, 1]
10477
10478 _.rangeRight(0, 20, 5);
10479 // => [15, 10, 5, 0]
10480
10481 _.rangeRight(0, -4, -1);
10482 // => [-3, -2, -1, 0]
10483
10484 _.rangeRight(1, 4, 0);
10485 // => [1, 1, 1]
10486
10487 _.rangeRight(0);
10488 // => []
10489 ```
10490 * * *
10491
10492 <!-- /div -->
10493
10494 <!-- div -->
10495
10496 ### <a id="_runincontextcontextroot"></a>`_.runInContext([context=root])`
10497 <a href="#_runincontextcontextroot">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L1239 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.runincontext "See the npm package")
10498
10499 Create a new pristine `lodash` function using the `context` object.
10500
10501 #### Since
10502 1.1.0
10503 #### Arguments
10504 1. `[context=root]` *(Object)*: The context object.
10505
10506 #### Returns
10507 *(Function)*: Returns a new `lodash` function.
10508
10509 #### Example
10510 ```js
10511 _.mixin({ 'foo': _.constant('foo') });
10512
10513 var lodash = _.runInContext();
10514 lodash.mixin({ 'bar': lodash.constant('bar') });
10515
10516 _.isFunction(_.foo);
10517 // => true
10518 _.isFunction(_.bar);
10519 // => false
10520
10521 lodash.isFunction(lodash.foo);
10522 // => false
10523 lodash.isFunction(lodash.bar);
10524 // => true
10525
10526 // Use `context` to mock `Date#getTime` use in `_.now`.
10527 var mock = _.runInContext({
10528   'Date': function() {
10529     return { 'getTime': getTimeMock };
10530   }
10531 });
10532
10533 // Create a suped-up `defer` in Node.js.
10534 var defer = _.runInContext({ 'setTimeout': setImmediate }).defer;
10535 ```
10536 * * *
10537
10538 <!-- /div -->
10539
10540 <!-- div -->
10541
10542 ### <a id="_timesn-iteratee_identity"></a>`_.times(n, [iteratee=_.identity])`
10543 <a href="#_timesn-iteratee_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L15139 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.times "See the npm package")
10544
10545 Invokes the iteratee `n` times, returning an array of the results of
10546 each invocation. The iteratee is invoked with one argument; *(index)*.
10547
10548 #### Since
10549 0.1.0
10550 #### Arguments
10551 1. `n` *(number)*: The number of times to invoke `iteratee`.
10552 2. `[iteratee=_.identity]` *(Function)*: The function invoked per iteration.
10553
10554 #### Returns
10555 *(Array)*: Returns the array of results.
10556
10557 #### Example
10558 ```js
10559 _.times(3, String);
10560 // => ['0', '1', '2']
10561
10562  _.times(4, _.constant(true));
10563 // => [true, true, true, true]
10564 ```
10565 * * *
10566
10567 <!-- /div -->
10568
10569 <!-- div -->
10570
10571 ### <a id="_topathvalue"></a>`_.toPath(value)`
10572 <a href="#_topathvalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L15183 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.topath "See the npm package")
10573
10574 Converts `value` to a property path array.
10575
10576 #### Since
10577 4.0.0
10578 #### Arguments
10579 1. `value` *(&#42;)*: The value to convert.
10580
10581 #### Returns
10582 *(Array)*: Returns the new property path array.
10583
10584 #### Example
10585 ```js
10586 _.toPath('a.b.c');
10587 // => ['a', 'b', 'c']
10588
10589 _.toPath('a[0].b.c');
10590 // => ['a', '0', 'b', 'c']
10591
10592 var path = ['a', 'b', 'c'],
10593     newPath = _.toPath(path);
10594
10595 console.log(newPath);
10596 // => ['a', 'b', 'c']
10597
10598 console.log(path === newPath);
10599 // => false
10600 ```
10601 * * *
10602
10603 <!-- /div -->
10604
10605 <!-- div -->
10606
10607 ### <a id="_uniqueidprefix"></a>`_.uniqueId([prefix=''])`
10608 <a href="#_uniqueidprefix">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L15207 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.uniqueid "See the npm package")
10609
10610 Generates a unique ID. If `prefix` is given, the ID is appended to it.
10611
10612 #### Since
10613 0.1.0
10614 #### Arguments
10615 1. `[prefix='']` *(string)*: The value to prefix the ID with.
10616
10617 #### Returns
10618 *(string)*: Returns the unique ID.
10619
10620 #### Example
10621 ```js
10622 _.uniqueId('contact_');
10623 // => 'contact_104'
10624
10625 _.uniqueId();
10626 // => '105'
10627 ```
10628 * * *
10629
10630 <!-- /div -->
10631
10632 <!-- /div -->
10633
10634 <!-- div -->
10635
10636 ## `Properties`
10637
10638 <!-- div -->
10639
10640 ### <a id="_version"></a>`_.VERSION`
10641 <a href="#_version">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L15894 "View in source") [&#x24C9;][1]
10642
10643 (string): The semantic version number.
10644
10645 * * *
10646
10647 <!-- /div -->
10648
10649 <!-- div -->
10650
10651 ### <a id="_templatesettings"></a>`_.templateSettings`
10652 <a href="#_templatesettings">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L1502 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.templatesettings "See the npm package")
10653
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.
10657
10658 * * *
10659
10660 <!-- /div -->
10661
10662 <!-- div -->
10663
10664 ### <a id="_templatesettingsescape"></a>`_.templateSettings.escape`
10665 <a href="#_templatesettingsescape">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L1510 "View in source") [&#x24C9;][1]
10666
10667 (RegExp): Used to detect `data` property values to be HTML-escaped.
10668
10669 * * *
10670
10671 <!-- /div -->
10672
10673 <!-- div -->
10674
10675 ### <a id="_templatesettingsevaluate"></a>`_.templateSettings.evaluate`
10676 <a href="#_templatesettingsevaluate">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L1518 "View in source") [&#x24C9;][1]
10677
10678 (RegExp): Used to detect code to be evaluated.
10679
10680 * * *
10681
10682 <!-- /div -->
10683
10684 <!-- div -->
10685
10686 ### <a id="_templatesettingsimports"></a>`_.templateSettings.imports`
10687 <a href="#_templatesettingsimports">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L1542 "View in source") [&#x24C9;][1]
10688
10689 (Object): Used to import variables into the compiled template.
10690
10691 * * *
10692
10693 <!-- /div -->
10694
10695 <!-- div -->
10696
10697 ### <a id="_templatesettingsinterpolate"></a>`_.templateSettings.interpolate`
10698 <a href="#_templatesettingsinterpolate">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L1526 "View in source") [&#x24C9;][1]
10699
10700 (RegExp): Used to detect `data` property values to inject.
10701
10702 * * *
10703
10704 <!-- /div -->
10705
10706 <!-- div -->
10707
10708 ### <a id="_templatesettingsvariable"></a>`_.templateSettings.variable`
10709 <a href="#_templatesettingsvariable">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L1534 "View in source") [&#x24C9;][1]
10710
10711 (string): Used to reference the data object in the template text.
10712
10713 * * *
10714
10715 <!-- /div -->
10716
10717 <!-- /div -->
10718
10719 <!-- div -->
10720
10721 ## `Methods`
10722
10723 <!-- div -->
10724
10725 ### <a id="_templatesettingsimports_"></a>`_.templateSettings.imports._`
10726 <a href="#_templatesettingsimports_">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.11.2/lodash.js#L1550 "View in source") [&#x24C9;][1]
10727
10728 A reference to the `lodash` function.
10729
10730 * * *
10731
10732 <!-- /div -->
10733
10734 <!-- /div -->
10735
10736 <!-- /div -->
10737
10738  [1]: #array "Jump back to the TOC."