ef5893cbf38c9c7430df47266966a63938381364
[motion.git] / public / bower_components / lodash / doc / README.md
1 # <a href="https://lodash.com/">lodash</a> <span>v4.5.1</span>
2
3 <!-- div class="toc-container" -->
4
5 <!-- div -->
6
7 ## `Array`
8 * <a href="#_chunkarray-size0">`_.chunk`</a>
9 * <a href="#_compactarray">`_.compact`</a>
10 * <a href="#_concatarray-values">`_.concat`</a>
11 * <a href="#_differencearray-values">`_.difference`</a>
12 * <a href="#_differencebyarray-values-iteratee_identity">`_.differenceBy`</a>
13 * <a href="#_differencewitharray-values-comparator">`_.differenceWith`</a>
14 * <a href="#_droparray-n1">`_.drop`</a>
15 * <a href="#_droprightarray-n1">`_.dropRight`</a>
16 * <a href="#_droprightwhilearray-predicate_identity">`_.dropRightWhile`</a>
17 * <a href="#_dropwhilearray-predicate_identity">`_.dropWhile`</a>
18 * <a href="#_fillarray-value-start0-endarraylength">`_.fill`</a>
19 * <a href="#_findindexarray-predicate_identity">`_.findIndex`</a>
20 * <a href="#_findlastindexarray-predicate_identity">`_.findLastIndex`</a>
21 * <a href="#_headarray" class="alias">`_.first` -> `head`</a>
22 * <a href="#_flattenarray">`_.flatten`</a>
23 * <a href="#_flattendeeparray">`_.flattenDeep`</a>
24 * <a href="#_flattendeptharray-depth1">`_.flattenDepth`</a>
25 * <a href="#_frompairspairs">`_.fromPairs`</a>
26 * <a href="#_headarray">`_.head`</a>
27 * <a href="#_indexofarray-value-fromindex0">`_.indexOf`</a>
28 * <a href="#_initialarray">`_.initial`</a>
29 * <a href="#_intersectionarrays">`_.intersection`</a>
30 * <a href="#_intersectionbyarrays-iteratee_identity">`_.intersectionBy`</a>
31 * <a href="#_intersectionwitharrays-comparator">`_.intersectionWith`</a>
32 * <a href="#_joinarray-separator-">`_.join`</a>
33 * <a href="#_lastarray">`_.last`</a>
34 * <a href="#_lastindexofarray-value-fromindexarraylength-1">`_.lastIndexOf`</a>
35 * <a href="#_pullarray-values">`_.pull`</a>
36 * <a href="#_pullallarray-values">`_.pullAll`</a>
37 * <a href="#_pullallbyarray-values-iteratee_identity">`_.pullAllBy`</a>
38 * <a href="#_pullatarray-indexes">`_.pullAt`</a>
39 * <a href="#_removearray-predicate_identity">`_.remove`</a>
40 * <a href="#_reverse">`_.reverse`</a>
41 * <a href="#_slicearray-start0-endarraylength">`_.slice`</a>
42 * <a href="#_sortedindexarray-value">`_.sortedIndex`</a>
43 * <a href="#_sortedindexbyarray-value-iteratee_identity">`_.sortedIndexBy`</a>
44 * <a href="#_sortedindexofarray-value">`_.sortedIndexOf`</a>
45 * <a href="#_sortedlastindexarray-value">`_.sortedLastIndex`</a>
46 * <a href="#_sortedlastindexbyarray-value-iteratee_identity">`_.sortedLastIndexBy`</a>
47 * <a href="#_sortedlastindexofarray-value">`_.sortedLastIndexOf`</a>
48 * <a href="#_sorteduniqarray">`_.sortedUniq`</a>
49 * <a href="#_sorteduniqbyarray-iteratee">`_.sortedUniqBy`</a>
50 * <a href="#_tailarray">`_.tail`</a>
51 * <a href="#_takearray-n1">`_.take`</a>
52 * <a href="#_takerightarray-n1">`_.takeRight`</a>
53 * <a href="#_takerightwhilearray-predicate_identity">`_.takeRightWhile`</a>
54 * <a href="#_takewhilearray-predicate_identity">`_.takeWhile`</a>
55 * <a href="#_unionarrays">`_.union`</a>
56 * <a href="#_unionbyarrays-iteratee_identity">`_.unionBy`</a>
57 * <a href="#_unionwitharrays-comparator">`_.unionWith`</a>
58 * <a href="#_uniqarray">`_.uniq`</a>
59 * <a href="#_uniqbyarray-iteratee_identity">`_.uniqBy`</a>
60 * <a href="#_uniqwitharray-comparator">`_.uniqWith`</a>
61 * <a href="#_unziparray">`_.unzip`</a>
62 * <a href="#_unzipwitharray-iteratee_identity">`_.unzipWith`</a>
63 * <a href="#_withoutarray-values">`_.without`</a>
64 * <a href="#_xorarrays">`_.xor`</a>
65 * <a href="#_xorbyarrays-iteratee_identity">`_.xorBy`</a>
66 * <a href="#_xorwitharrays-comparator">`_.xorWith`</a>
67 * <a href="#_ziparrays">`_.zip`</a>
68 * <a href="#_zipobjectprops-values">`_.zipObject`</a>
69 * <a href="#_zipobjectdeepprops-values">`_.zipObjectDeep`</a>
70 * <a href="#_zipwitharrays-iteratee_identity">`_.zipWith`</a>
71
72 <!-- /div -->
73
74 <!-- div -->
75
76 ## `Collection`
77 * <a href="#_countbycollection-iteratee_identity">`_.countBy`</a>
78 * <a href="#_foreachcollection-iteratee_identity" class="alias">`_.each` -> `forEach`</a>
79 * <a href="#_foreachrightcollection-iteratee_identity" class="alias">`_.eachRight` -> `forEachRight`</a>
80 * <a href="#_everycollection-predicate_identity">`_.every`</a>
81 * <a href="#_filtercollection-predicate_identity">`_.filter`</a>
82 * <a href="#_findcollection-predicate_identity">`_.find`</a>
83 * <a href="#_findlastcollection-predicate_identity">`_.findLast`</a>
84 * <a href="#_flatmapcollection-iteratee_identity">`_.flatMap`</a>
85 * <a href="#_foreachcollection-iteratee_identity">`_.forEach`</a>
86 * <a href="#_foreachrightcollection-iteratee_identity">`_.forEachRight`</a>
87 * <a href="#_groupbycollection-iteratee_identity">`_.groupBy`</a>
88 * <a href="#_includescollection-value-fromindex0">`_.includes`</a>
89 * <a href="#_invokemapcollection-path-args">`_.invokeMap`</a>
90 * <a href="#_keybycollection-iteratee_identity">`_.keyBy`</a>
91 * <a href="#_mapcollection-iteratee_identity">`_.map`</a>
92 * <a href="#_orderbycollection-iteratees-_identity-orders">`_.orderBy`</a>
93 * <a href="#_partitioncollection-predicate_identity">`_.partition`</a>
94 * <a href="#_reducecollection-iteratee_identity-accumulator">`_.reduce`</a>
95 * <a href="#_reducerightcollection-iteratee_identity-accumulator">`_.reduceRight`</a>
96 * <a href="#_rejectcollection-predicate_identity">`_.reject`</a>
97 * <a href="#_samplecollection">`_.sample`</a>
98 * <a href="#_samplesizecollection-n0">`_.sampleSize`</a>
99 * <a href="#_shufflecollection">`_.shuffle`</a>
100 * <a href="#_sizecollection">`_.size`</a>
101 * <a href="#_somecollection-predicate_identity">`_.some`</a>
102 * <a href="#_sortbycollection-iteratees-_identity">`_.sortBy`</a>
103
104 <!-- /div -->
105
106 <!-- div -->
107
108 ## `Date`
109 * <a href="#_now">`_.now`</a>
110
111 <!-- /div -->
112
113 <!-- div -->
114
115 ## `Function`
116 * <a href="#_aftern-func">`_.after`</a>
117 * <a href="#_aryfunc-nfunclength">`_.ary`</a>
118 * <a href="#_beforen-func">`_.before`</a>
119 * <a href="#_bindfunc-thisarg-partials">`_.bind`</a>
120 * <a href="#_bindkeyobject-key-partials">`_.bindKey`</a>
121 * <a href="#_curryfunc-arityfunclength">`_.curry`</a>
122 * <a href="#_curryrightfunc-arityfunclength">`_.curryRight`</a>
123 * <a href="#_debouncefunc-wait0-options">`_.debounce`</a>
124 * <a href="#_deferfunc-args">`_.defer`</a>
125 * <a href="#_delayfunc-wait-args">`_.delay`</a>
126 * <a href="#_flipfunc">`_.flip`</a>
127 * <a href="#_memoizefunc-resolver">`_.memoize`</a>
128 * <a href="#_negatepredicate">`_.negate`</a>
129 * <a href="#_oncefunc">`_.once`</a>
130 * <a href="#_overargsfunc-transforms">`_.overArgs`</a>
131 * <a href="#_partialfunc-partials">`_.partial`</a>
132 * <a href="#_partialrightfunc-partials">`_.partialRight`</a>
133 * <a href="#_reargfunc-indexes">`_.rearg`</a>
134 * <a href="#_restfunc-startfunclength-1">`_.rest`</a>
135 * <a href="#_spreadfunc-start0">`_.spread`</a>
136 * <a href="#_throttlefunc-wait0-options">`_.throttle`</a>
137 * <a href="#_unaryfunc">`_.unary`</a>
138 * <a href="#_wrapvalue-wrapperidentity">`_.wrap`</a>
139
140 <!-- /div -->
141
142 <!-- div -->
143
144 ## `Lang`
145 * <a href="#_castarrayvalue">`_.castArray`</a>
146 * <a href="#_clonevalue">`_.clone`</a>
147 * <a href="#_clonedeepvalue">`_.cloneDeep`</a>
148 * <a href="#_clonedeepwithvalue-customizer">`_.cloneDeepWith`</a>
149 * <a href="#_clonewithvalue-customizer">`_.cloneWith`</a>
150 * <a href="#_eqvalue-other">`_.eq`</a>
151 * <a href="#_gtvalue-other">`_.gt`</a>
152 * <a href="#_gtevalue-other">`_.gte`</a>
153 * <a href="#_isargumentsvalue">`_.isArguments`</a>
154 * <a href="#_isarrayvalue">`_.isArray`</a>
155 * <a href="#_isarraybuffervalue">`_.isArrayBuffer`</a>
156 * <a href="#_isarraylikevalue">`_.isArrayLike`</a>
157 * <a href="#_isarraylikeobjectvalue">`_.isArrayLikeObject`</a>
158 * <a href="#_isbooleanvalue">`_.isBoolean`</a>
159 * <a href="#_isbuffervalue">`_.isBuffer`</a>
160 * <a href="#_isdatevalue">`_.isDate`</a>
161 * <a href="#_iselementvalue">`_.isElement`</a>
162 * <a href="#_isemptyvalue">`_.isEmpty`</a>
163 * <a href="#_isequalvalue-other">`_.isEqual`</a>
164 * <a href="#_isequalwithvalue-other-customizer">`_.isEqualWith`</a>
165 * <a href="#_iserrorvalue">`_.isError`</a>
166 * <a href="#_isfinitevalue">`_.isFinite`</a>
167 * <a href="#_isfunctionvalue">`_.isFunction`</a>
168 * <a href="#_isintegervalue">`_.isInteger`</a>
169 * <a href="#_islengthvalue">`_.isLength`</a>
170 * <a href="#_ismapvalue">`_.isMap`</a>
171 * <a href="#_ismatchobject-source">`_.isMatch`</a>
172 * <a href="#_ismatchwithobject-source-customizer">`_.isMatchWith`</a>
173 * <a href="#_isnanvalue">`_.isNaN`</a>
174 * <a href="#_isnativevalue">`_.isNative`</a>
175 * <a href="#_isnilvalue">`_.isNil`</a>
176 * <a href="#_isnullvalue">`_.isNull`</a>
177 * <a href="#_isnumbervalue">`_.isNumber`</a>
178 * <a href="#_isobjectvalue">`_.isObject`</a>
179 * <a href="#_isobjectlikevalue">`_.isObjectLike`</a>
180 * <a href="#_isplainobjectvalue">`_.isPlainObject`</a>
181 * <a href="#_isregexpvalue">`_.isRegExp`</a>
182 * <a href="#_issafeintegervalue">`_.isSafeInteger`</a>
183 * <a href="#_issetvalue">`_.isSet`</a>
184 * <a href="#_isstringvalue">`_.isString`</a>
185 * <a href="#_issymbolvalue">`_.isSymbol`</a>
186 * <a href="#_istypedarrayvalue">`_.isTypedArray`</a>
187 * <a href="#_isundefinedvalue">`_.isUndefined`</a>
188 * <a href="#_isweakmapvalue">`_.isWeakMap`</a>
189 * <a href="#_isweaksetvalue">`_.isWeakSet`</a>
190 * <a href="#_ltvalue-other">`_.lt`</a>
191 * <a href="#_ltevalue-other">`_.lte`</a>
192 * <a href="#_toarrayvalue">`_.toArray`</a>
193 * <a href="#_tointegervalue">`_.toInteger`</a>
194 * <a href="#_tolengthvalue">`_.toLength`</a>
195 * <a href="#_tonumbervalue">`_.toNumber`</a>
196 * <a href="#_toplainobjectvalue">`_.toPlainObject`</a>
197 * <a href="#_tosafeintegervalue">`_.toSafeInteger`</a>
198 * <a href="#_tostringvalue">`_.toString`</a>
199
200 <!-- /div -->
201
202 <!-- div -->
203
204 ## `Math`
205 * <a href="#_addaugend-addend">`_.add`</a>
206 * <a href="#_ceilnumber-precision0">`_.ceil`</a>
207 * <a href="#_floornumber-precision0">`_.floor`</a>
208 * <a href="#_maxarray">`_.max`</a>
209 * <a href="#_maxbyarray-iteratee_identity">`_.maxBy`</a>
210 * <a href="#_meanarray">`_.mean`</a>
211 * <a href="#_minarray">`_.min`</a>
212 * <a href="#_minbyarray-iteratee_identity">`_.minBy`</a>
213 * <a href="#_roundnumber-precision0">`_.round`</a>
214 * <a href="#_subtractminuend-subtrahend">`_.subtract`</a>
215 * <a href="#_sumarray">`_.sum`</a>
216 * <a href="#_sumbyarray-iteratee_identity">`_.sumBy`</a>
217
218 <!-- /div -->
219
220 <!-- div -->
221
222 ## `Number`
223 * <a href="#_clampnumber-lower-upper">`_.clamp`</a>
224 * <a href="#_inrangenumber-start0-end">`_.inRange`</a>
225 * <a href="#_randomlower0-upper1-floating">`_.random`</a>
226
227 <!-- /div -->
228
229 <!-- div -->
230
231 ## `Object`
232 * <a href="#_assignobject-sources">`_.assign`</a>
233 * <a href="#_assigninobject-sources">`_.assignIn`</a>
234 * <a href="#_assigninwithobject-sources-customizer">`_.assignInWith`</a>
235 * <a href="#_assignwithobject-sources-customizer">`_.assignWith`</a>
236 * <a href="#_atobject-paths">`_.at`</a>
237 * <a href="#_createprototype-properties">`_.create`</a>
238 * <a href="#_defaultsobject-sources">`_.defaults`</a>
239 * <a href="#_defaultsdeepobject-sources">`_.defaultsDeep`</a>
240 * <a href="#_assigninobject-sources" class="alias">`_.extend` -> `assignIn`</a>
241 * <a href="#_assigninwithobject-sources-customizer" class="alias">`_.extendWith` -> `assignInWith`</a>
242 * <a href="#_findkeyobject-predicate_identity">`_.findKey`</a>
243 * <a href="#_findlastkeyobject-predicate_identity">`_.findLastKey`</a>
244 * <a href="#_forinobject-iteratee_identity">`_.forIn`</a>
245 * <a href="#_forinrightobject-iteratee_identity">`_.forInRight`</a>
246 * <a href="#_forownobject-iteratee_identity">`_.forOwn`</a>
247 * <a href="#_forownrightobject-iteratee_identity">`_.forOwnRight`</a>
248 * <a href="#_functionsobject">`_.functions`</a>
249 * <a href="#_functionsinobject">`_.functionsIn`</a>
250 * <a href="#_getobject-path-defaultvalue">`_.get`</a>
251 * <a href="#_hasobject-path">`_.has`</a>
252 * <a href="#_hasinobject-path">`_.hasIn`</a>
253 * <a href="#_invertobject">`_.invert`</a>
254 * <a href="#_invertbyobject-iteratee_identity">`_.invertBy`</a>
255 * <a href="#_invokeobject-path-args">`_.invoke`</a>
256 * <a href="#_keysobject">`_.keys`</a>
257 * <a href="#_keysinobject">`_.keysIn`</a>
258 * <a href="#_mapkeysobject-iteratee_identity">`_.mapKeys`</a>
259 * <a href="#_mapvaluesobject-iteratee_identity">`_.mapValues`</a>
260 * <a href="#_mergeobject-sources">`_.merge`</a>
261 * <a href="#_mergewithobject-sources-customizer">`_.mergeWith`</a>
262 * <a href="#_omitobject-props">`_.omit`</a>
263 * <a href="#_omitbyobject-predicate_identity">`_.omitBy`</a>
264 * <a href="#_pickobject-props">`_.pick`</a>
265 * <a href="#_pickbyobject-predicate_identity">`_.pickBy`</a>
266 * <a href="#_resultobject-path-defaultvalue">`_.result`</a>
267 * <a href="#_setobject-path-value">`_.set`</a>
268 * <a href="#_setwithobject-path-value-customizer">`_.setWith`</a>
269 * <a href="#_topairsobject">`_.toPairs`</a>
270 * <a href="#_topairsinobject">`_.toPairsIn`</a>
271 * <a href="#_transformobject-iteratee_identity-accumulator">`_.transform`</a>
272 * <a href="#_unsetobject-path">`_.unset`</a>
273 * <a href="#_valuesobject">`_.values`</a>
274 * <a href="#_valuesinobject">`_.valuesIn`</a>
275
276 <!-- /div -->
277
278 <!-- div -->
279
280 ## `Seq`
281 * <a href="#_value">`_`</a>
282 * <a href="#_chainvalue">`_.chain`</a>
283 * <a href="#_tapvalue-interceptor">`_.tap`</a>
284 * <a href="#_thruvalue-interceptor">`_.thru`</a>
285 * <a href="#_prototypesymboliterator">`_.prototype[Symbol.iterator]`</a>
286 * <a href="#_prototypeatpaths">`_.prototype.at`</a>
287 * <a href="#_prototypechain">`_.prototype.chain`</a>
288 * <a href="#_prototypecommit">`_.prototype.commit`</a>
289 * <a href="#_prototypeflatmapiteratee_identity">`_.prototype.flatMap`</a>
290 * <a href="#_prototypenext">`_.prototype.next`</a>
291 * <a href="#_prototypeplantvalue">`_.prototype.plant`</a>
292 * <a href="#_prototypereverse">`_.prototype.reverse`</a>
293 * <a href="#_prototypevalue" class="alias">`_.prototype.toJSON` -> `value`</a>
294 * <a href="#_prototypevalue">`_.prototype.value`</a>
295 * <a href="#_prototypevalue" class="alias">`_.prototype.valueOf` -> `value`</a>
296
297 <!-- /div -->
298
299 <!-- div -->
300
301 ## `String`
302 * <a href="#_camelcasestring">`_.camelCase`</a>
303 * <a href="#_capitalizestring">`_.capitalize`</a>
304 * <a href="#_deburrstring">`_.deburr`</a>
305 * <a href="#_endswithstring-target-positionstringlength">`_.endsWith`</a>
306 * <a href="#_escapestring">`_.escape`</a>
307 * <a href="#_escaperegexpstring">`_.escapeRegExp`</a>
308 * <a href="#_kebabcasestring">`_.kebabCase`</a>
309 * <a href="#_lowercasestring">`_.lowerCase`</a>
310 * <a href="#_lowerfirststring">`_.lowerFirst`</a>
311 * <a href="#_padstring-length0-chars">`_.pad`</a>
312 * <a href="#_padendstring-length0-chars">`_.padEnd`</a>
313 * <a href="#_padstartstring-length0-chars">`_.padStart`</a>
314 * <a href="#_parseintstring-radix10">`_.parseInt`</a>
315 * <a href="#_repeatstring-n0">`_.repeat`</a>
316 * <a href="#_replacestring-pattern-replacement">`_.replace`</a>
317 * <a href="#_snakecasestring">`_.snakeCase`</a>
318 * <a href="#_splitstring-separator-limit">`_.split`</a>
319 * <a href="#_startcasestring">`_.startCase`</a>
320 * <a href="#_startswithstring-target-position0">`_.startsWith`</a>
321 * <a href="#_templatestring-options">`_.template`</a>
322 * <a href="#_tolowerstring">`_.toLower`</a>
323 * <a href="#_toupperstring">`_.toUpper`</a>
324 * <a href="#_trimstring-charswhitespace">`_.trim`</a>
325 * <a href="#_trimendstring-charswhitespace">`_.trimEnd`</a>
326 * <a href="#_trimstartstring-charswhitespace">`_.trimStart`</a>
327 * <a href="#_truncatestring-options-optionslength30-optionsomission-optionsseparator">`_.truncate`</a>
328 * <a href="#_unescapestring">`_.unescape`</a>
329 * <a href="#_uppercasestring">`_.upperCase`</a>
330 * <a href="#_upperfirststring">`_.upperFirst`</a>
331 * <a href="#_wordsstring-pattern">`_.words`</a>
332
333 <!-- /div -->
334
335 <!-- div -->
336
337 ## `Util`
338 * <a href="#_attemptfunc">`_.attempt`</a>
339 * <a href="#_bindallobject-methodnames">`_.bindAll`</a>
340 * <a href="#_condpairs">`_.cond`</a>
341 * <a href="#_conformssource">`_.conforms`</a>
342 * <a href="#_constantvalue">`_.constant`</a>
343 * <a href="#_flowfuncs">`_.flow`</a>
344 * <a href="#_flowrightfuncs">`_.flowRight`</a>
345 * <a href="#_identityvalue">`_.identity`</a>
346 * <a href="#_iterateefunc_identity">`_.iteratee`</a>
347 * <a href="#_matchessource">`_.matches`</a>
348 * <a href="#_matchespropertypath-srcvalue">`_.matchesProperty`</a>
349 * <a href="#_methodpath-args">`_.method`</a>
350 * <a href="#_methodofobject-args">`_.methodOf`</a>
351 * <a href="#_mixinobjectlodash-source-options">`_.mixin`</a>
352 * <a href="#_noconflict">`_.noConflict`</a>
353 * <a href="#_noop">`_.noop`</a>
354 * <a href="#_nthargn0">`_.nthArg`</a>
355 * <a href="#_overiteratees">`_.over`</a>
356 * <a href="#_overeverypredicates">`_.overEvery`</a>
357 * <a href="#_oversomepredicates">`_.overSome`</a>
358 * <a href="#_propertypath">`_.property`</a>
359 * <a href="#_propertyofobject">`_.propertyOf`</a>
360 * <a href="#_rangestart0-end-step1">`_.range`</a>
361 * <a href="#_rangerightstart0-end-step1">`_.rangeRight`</a>
362 * <a href="#_runincontextcontextroot">`_.runInContext`</a>
363 * <a href="#_timesn-iteratee_identity">`_.times`</a>
364 * <a href="#_topathvalue">`_.toPath`</a>
365 * <a href="#_uniqueidprefix">`_.uniqueId`</a>
366
367 <!-- /div -->
368
369 <!-- div -->
370
371 ## `Properties`
372 * <a href="#_version">`_.VERSION`</a>
373 * <a href="#_templatesettings">`_.templateSettings`</a>
374 * <a href="#_templatesettingsescape">`_.templateSettings.escape`</a>
375 * <a href="#_templatesettingsevaluate">`_.templateSettings.evaluate`</a>
376 * <a href="#_templatesettingsimports">`_.templateSettings.imports`</a>
377 * <a href="#_templatesettingsimports_">`_.templateSettings.imports._`</a>
378 * <a href="#_templatesettingsinterpolate">`_.templateSettings.interpolate`</a>
379 * <a href="#_templatesettingsvariable">`_.templateSettings.variable`</a>
380
381 <!-- /div -->
382
383 <!-- /div -->
384
385 <!-- div class="doc-container" -->
386
387 <!-- div -->
388
389 ## `“Array” Methods`
390
391 <!-- div -->
392
393 ### <a id="_chunkarray-size0"></a>`_.chunk(array, [size=0])`
394 <a href="#_chunkarray-size0">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L5480 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.chunk "See the npm package")
395
396 Creates an array of elements split into groups the length of `size`.
397 If `array` can't be split evenly, the final chunk will be the remaining
398 elements.
399
400 #### Arguments
401 1. `array` *(Array)*: The array to process.
402 2. `[size=0]` *(number)*: The length of each chunk.
403
404 #### Returns
405 *(Array)*:  Returns the new array containing chunks.
406
407 #### Example
408 ```js
409 _.chunk(['a', 'b', 'c', 'd'], 2);
410 // => [['a', 'b'], ['c', 'd']]
411
412 _.chunk(['a', 'b', 'c', 'd'], 3);
413 // => [['a', 'b', 'c'], ['d']]
414 ```
415 * * *
416
417 <!-- /div -->
418
419 <!-- div -->
420
421 ### <a id="_compactarray"></a>`_.compact(array)`
422 <a href="#_compactarray">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L5511 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.compact "See the npm package")
423
424 Creates an array with all falsey values removed. The values `false`, `null`,
425 `0`, `""`, `undefined`, and `NaN` are falsey.
426
427 #### Arguments
428 1. `array` *(Array)*: The array to compact.
429
430 #### Returns
431 *(Array)*:  Returns the new array of filtered values.
432
433 #### Example
434 ```js
435 _.compact([0, 1, false, 2, '', 3]);
436 // => [1, 2, 3]
437 ```
438 * * *
439
440 <!-- /div -->
441
442 <!-- div -->
443
444 ### <a id="_concatarray-values"></a>`_.concat(array, [values])`
445 <a href="#_concatarray-values">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L5547 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.concat "See the npm package")
446
447 Creates a new array concatenating `array` with any additional arrays
448 and/or values.
449
450 #### Arguments
451 1. `array` *(Array)*: The array to concatenate.
452 2. `[values]` *(...&#42;)*: The values to concatenate.
453
454 #### Returns
455 *(Array)*:  Returns the new concatenated array.
456
457 #### Example
458 ```js
459 var array = [1];
460 var other = _.concat(array, 2, [3], [[4]]);
461
462 console.log(other);
463 // => [1, 2, 3, [4]]
464
465 console.log(array);
466 // => [1]
467 ```
468 * * *
469
470 <!-- /div -->
471
472 <!-- div -->
473
474 ### <a id="_differencearray-values"></a>`_.difference(array, [values])`
475 <a href="#_differencearray-values">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L5571 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.difference "See the npm package")
476
477 Creates an array of unique `array` values not included in the other
478 given arrays using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
479 for equality comparisons.
480
481 #### Arguments
482 1. `array` *(Array)*: The array to inspect.
483 2. `[values]` *(...Array)*: The values to exclude.
484
485 #### Returns
486 *(Array)*:  Returns the new array of filtered values.
487
488 #### Example
489 ```js
490 _.difference([3, 2, 1], [4, 2]);
491 // => [3, 1]
492 ```
493 * * *
494
495 <!-- /div -->
496
497 <!-- div -->
498
499 ### <a id="_differencebyarray-values-iteratee_identity"></a>`_.differenceBy(array, [values], [iteratee=_.identity])`
500 <a href="#_differencebyarray-values-iteratee_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L5598 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.differenceby "See the npm package")
501
502 This method is like `_.difference` except that it accepts `iteratee` which
503 is invoked for each element of `array` and `values` to generate the criterion
504 by which uniqueness is computed. The iteratee is invoked with one argument: (value).
505
506 #### Arguments
507 1. `array` *(Array)*: The array to inspect.
508 2. `[values]` *(...Array)*: The values to exclude.
509 3. `[iteratee=_.identity]` *(Function|Object|string)*: The iteratee invoked per element.
510
511 #### Returns
512 *(Array)*:  Returns the new array of filtered values.
513
514 #### Example
515 ```js
516 _.differenceBy([3.1, 2.2, 1.3], [4.4, 2.5], Math.floor);
517 // => [3.1, 1.3]
518
519 // The `_.property` iteratee shorthand.
520 _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x');
521 // => [{ 'x': 2 }]
522 ```
523 * * *
524
525 <!-- /div -->
526
527 <!-- div -->
528
529 ### <a id="_differencewitharray-values-comparator"></a>`_.differenceWith(array, [values], [comparator])`
530 <a href="#_differencewitharray-values-comparator">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L5627 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.differencewith "See the npm package")
531
532 This method is like `_.difference` except that it accepts `comparator`
533 which is invoked to compare elements of `array` to `values`. The comparator
534 is invoked with two arguments: (arrVal, othVal).
535
536 #### Arguments
537 1. `array` *(Array)*: The array to inspect.
538 2. `[values]` *(...Array)*: The values to exclude.
539 3. `[comparator]` *(Function)*: The comparator invoked per element.
540
541 #### Returns
542 *(Array)*:  Returns the new array of filtered values.
543
544 #### Example
545 ```js
546 var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
547
548 _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual);
549 // => [{ 'x': 2, 'y': 1 }]
550 ```
551 * * *
552
553 <!-- /div -->
554
555 <!-- div -->
556
557 ### <a id="_droparray-n1"></a>`_.drop(array, [n=1])`
558 <a href="#_droparray-n1">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L5661 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.drop "See the npm package")
559
560 Creates a slice of `array` with `n` elements dropped from the beginning.
561
562 #### Arguments
563 1. `array` *(Array)*: The array to query.
564 2. `[n=1]` *(number)*: The number of elements to drop.
565
566 #### Returns
567 *(Array)*:  Returns the slice of `array`.
568
569 #### Example
570 ```js
571 _.drop([1, 2, 3]);
572 // => [2, 3]
573
574 _.drop([1, 2, 3], 2);
575 // => [3]
576
577 _.drop([1, 2, 3], 5);
578 // => []
579
580 _.drop([1, 2, 3], 0);
581 // => [1, 2, 3]
582 ```
583 * * *
584
585 <!-- /div -->
586
587 <!-- div -->
588
589 ### <a id="_droprightarray-n1"></a>`_.dropRight(array, [n=1])`
590 <a href="#_droprightarray-n1">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L5694 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.dropright "See the npm package")
591
592 Creates a slice of `array` with `n` elements dropped from the end.
593
594 #### Arguments
595 1. `array` *(Array)*: The array to query.
596 2. `[n=1]` *(number)*: The number of elements to drop.
597
598 #### Returns
599 *(Array)*:  Returns the slice of `array`.
600
601 #### Example
602 ```js
603 _.dropRight([1, 2, 3]);
604 // => [1, 2]
605
606 _.dropRight([1, 2, 3], 2);
607 // => [1]
608
609 _.dropRight([1, 2, 3], 5);
610 // => []
611
612 _.dropRight([1, 2, 3], 0);
613 // => [1, 2, 3]
614 ```
615 * * *
616
617 <!-- /div -->
618
619 <!-- div -->
620
621 ### <a id="_droprightwhilearray-predicate_identity"></a>`_.dropRightWhile(array, [predicate=_.identity])`
622 <a href="#_droprightwhilearray-predicate_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L5738 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.droprightwhile "See the npm package")
623
624 Creates a slice of `array` excluding elements dropped from the end.
625 Elements are dropped until `predicate` returns falsey. The predicate is
626 invoked with three arguments: (value, index, array).
627
628 #### Arguments
629 1. `array` *(Array)*: The array to query.
630 2. `[predicate=_.identity]` *(Function|Object|string)*: The function invoked per iteration.
631
632 #### Returns
633 *(Array)*:  Returns the slice of `array`.
634
635 #### Example
636 ```js
637 var users = [
638   { 'user': 'barney',  'active': true },
639   { 'user': 'fred',    'active': false },
640   { 'user': 'pebbles', 'active': false }
641 ];
642
643 _.dropRightWhile(users, function(o) { return !o.active; });
644 // => objects for ['barney']
645
646 // The `_.matches` iteratee shorthand.
647 _.dropRightWhile(users, { 'user': 'pebbles', 'active': false });
648 // => objects for ['barney', 'fred']
649
650 // The `_.matchesProperty` iteratee shorthand.
651 _.dropRightWhile(users, ['active', false]);
652 // => objects for ['barney']
653
654 // The `_.property` iteratee shorthand.
655 _.dropRightWhile(users, 'active');
656 // => objects for ['barney', 'fred', 'pebbles']
657 ```
658 * * *
659
660 <!-- /div -->
661
662 <!-- div -->
663
664 ### <a id="_dropwhilearray-predicate_identity"></a>`_.dropWhile(array, [predicate=_.identity])`
665 <a href="#_dropwhilearray-predicate_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L5778 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.dropwhile "See the npm package")
666
667 Creates a slice of `array` excluding elements dropped from the beginning.
668 Elements are dropped until `predicate` returns falsey. The predicate is
669 invoked with three arguments: (value, index, array).
670
671 #### Arguments
672 1. `array` *(Array)*: The array to query.
673 2. `[predicate=_.identity]` *(Function|Object|string)*: The function invoked per iteration.
674
675 #### Returns
676 *(Array)*:  Returns the slice of `array`.
677
678 #### Example
679 ```js
680 var users = [
681   { 'user': 'barney',  'active': false },
682   { 'user': 'fred',    'active': false },
683   { 'user': 'pebbles', 'active': true }
684 ];
685
686 _.dropWhile(users, function(o) { return !o.active; });
687 // => objects for ['pebbles']
688
689 // The `_.matches` iteratee shorthand.
690 _.dropWhile(users, { 'user': 'barney', 'active': false });
691 // => objects for ['fred', 'pebbles']
692
693 // The `_.matchesProperty` iteratee shorthand.
694 _.dropWhile(users, ['active', false]);
695 // => objects for ['pebbles']
696
697 // The `_.property` iteratee shorthand.
698 _.dropWhile(users, 'active');
699 // => objects for ['barney', 'fred', 'pebbles']
700 ```
701 * * *
702
703 <!-- /div -->
704
705 <!-- div -->
706
707 ### <a id="_fillarray-value-start0-endarraylength"></a>`_.fill(array, value, [start=0], [end=array.length])`
708 <a href="#_fillarray-value-start0-endarraylength">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L5812 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.fill "See the npm package")
709
710 Fills elements of `array` with `value` from `start` up to, but not
711 including, `end`.
712 <br>
713 <br>
714 **Note:** This method mutates `array`.
715
716 #### Arguments
717 1. `array` *(Array)*: The array to fill.
718 2. `value` *(&#42;)*: The value to fill `array` with.
719 3. `[start=0]` *(number)*: The start position.
720 4. `[end=array.length]` *(number)*: The end position.
721
722 #### Returns
723 *(Array)*:  Returns `array`.
724
725 #### Example
726 ```js
727 var array = [1, 2, 3];
728
729 _.fill(array, 'a');
730 console.log(array);
731 // => ['a', 'a', 'a']
732
733 _.fill(Array(3), 2);
734 // => [2, 2, 2]
735
736 _.fill([4, 6, 8, 10], '*', 1, 3);
737 // => [4, '*', '*', 10]
738 ```
739 * * *
740
741 <!-- /div -->
742
743 <!-- div -->
744
745 ### <a id="_findindexarray-predicate_identity"></a>`_.findIndex(array, [predicate=_.identity])`
746 <a href="#_findindexarray-predicate_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L5857 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.findindex "See the npm package")
747
748 This method is like `_.find` except that it returns the index of the first
749 element `predicate` returns truthy for instead of the element itself.
750
751 #### Arguments
752 1. `array` *(Array)*: The array to search.
753 2. `[predicate=_.identity]` *(Function|Object|string)*: The function invoked per iteration.
754
755 #### Returns
756 *(number)*:  Returns the index of the found element, else `-1`.
757
758 #### Example
759 ```js
760 var users = [
761   { 'user': 'barney',  'active': false },
762   { 'user': 'fred',    'active': false },
763   { 'user': 'pebbles', 'active': true }
764 ];
765
766 _.findIndex(users, function(o) { return o.user == 'barney'; });
767 // => 0
768
769 // The `_.matches` iteratee shorthand.
770 _.findIndex(users, { 'user': 'fred', 'active': false });
771 // => 1
772
773 // The `_.matchesProperty` iteratee shorthand.
774 _.findIndex(users, ['active', false]);
775 // => 0
776
777 // The `_.property` iteratee shorthand.
778 _.findIndex(users, 'active');
779 // => 2
780 ```
781 * * *
782
783 <!-- /div -->
784
785 <!-- div -->
786
787 ### <a id="_findlastindexarray-predicate_identity"></a>`_.findLastIndex(array, [predicate=_.identity])`
788 <a href="#_findlastindexarray-predicate_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L5896 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.findlastindex "See the npm package")
789
790 This method is like `_.findIndex` except that it iterates over elements
791 of `collection` from right to left.
792
793 #### Arguments
794 1. `array` *(Array)*: The array to search.
795 2. `[predicate=_.identity]` *(Function|Object|string)*: The function invoked per iteration.
796
797 #### Returns
798 *(number)*:  Returns the index of the found element, else `-1`.
799
800 #### Example
801 ```js
802 var users = [
803   { 'user': 'barney',  'active': true },
804   { 'user': 'fred',    'active': false },
805   { 'user': 'pebbles', 'active': false }
806 ];
807
808 _.findLastIndex(users, function(o) { return o.user == 'pebbles'; });
809 // => 2
810
811 // The `_.matches` iteratee shorthand.
812 _.findLastIndex(users, { 'user': 'barney', 'active': true });
813 // => 0
814
815 // The `_.matchesProperty` iteratee shorthand.
816 _.findLastIndex(users, ['active', false]);
817 // => 2
818
819 // The `_.property` iteratee shorthand.
820 _.findLastIndex(users, 'active');
821 // => 0
822 ```
823 * * *
824
825 <!-- /div -->
826
827 <!-- div -->
828
829 ### <a id="_flattenarray"></a>`_.flatten(array)`
830 <a href="#_flattenarray">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L5915 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.flatten "See the npm package")
831
832 Flattens `array` a single level deep.
833
834 #### Arguments
835 1. `array` *(Array)*: The array to flatten.
836
837 #### Returns
838 *(Array)*:  Returns the new flattened array.
839
840 #### Example
841 ```js
842 _.flatten([1, [2, [3, [4]], 5]]);
843 // => [1, 2, [3, [4]], 5]
844 ```
845 * * *
846
847 <!-- /div -->
848
849 <!-- div -->
850
851 ### <a id="_flattendeeparray"></a>`_.flattenDeep(array)`
852 <a href="#_flattendeeparray">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L5933 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.flattendeep "See the npm package")
853
854 Recursively flattens `array`.
855
856 #### Arguments
857 1. `array` *(Array)*: The array to flatten.
858
859 #### Returns
860 *(Array)*:  Returns the new flattened array.
861
862 #### Example
863 ```js
864 _.flattenDeep([1, [2, [3, [4]], 5]]);
865 // => [1, 2, 3, 4, 5]
866 ```
867 * * *
868
869 <!-- /div -->
870
871 <!-- div -->
872
873 ### <a id="_flattendeptharray-depth1"></a>`_.flattenDepth(array, [depth=1])`
874 <a href="#_flattendeptharray-depth1">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L5957 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.flattendepth "See the npm package")
875
876 Recursively flatten `array` up to `depth` times.
877
878 #### Arguments
879 1. `array` *(Array)*: The array to flatten.
880 2. `[depth=1]` *(number)*: The maximum recursion depth.
881
882 #### Returns
883 *(Array)*:  Returns the new flattened array.
884
885 #### Example
886 ```js
887 var array = [1, [2, [3, [4]], 5]];
888
889 _.flattenDepth(array, 1);
890 // => [1, 2, [3, [4]], 5]
891
892 _.flattenDepth(array, 2);
893 // => [1, 2, 3, [4], 5]
894 ```
895 * * *
896
897 <!-- /div -->
898
899 <!-- div -->
900
901 ### <a id="_frompairspairs"></a>`_.fromPairs(pairs)`
902 <a href="#_frompairspairs">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L5980 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.frompairs "See the npm package")
903
904 The inverse of `_.toPairs`; this method returns an object composed
905 from key-value `pairs`.
906
907 #### Arguments
908 1. `pairs` *(Array)*: The key-value pairs.
909
910 #### Returns
911 *(Object)*:  Returns the new object.
912
913 #### Example
914 ```js
915 _.fromPairs([['fred', 30], ['barney', 40]]);
916 // => { 'fred': 30, 'barney': 40 }
917 ```
918 * * *
919
920 <!-- /div -->
921
922 <!-- div -->
923
924 ### <a id="_headarray"></a>`_.head(array)`
925 <a href="#_headarray">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L6009 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.head "See the npm package")
926
927 Gets the first element of `array`.
928
929 #### Aliases
930 *_.first*
931
932 #### Arguments
933 1. `array` *(Array)*: The array to query.
934
935 #### Returns
936 *(&#42;)*:  Returns the first element of `array`.
937
938 #### Example
939 ```js
940 _.head([1, 2, 3]);
941 // => 1
942
943 _.head([]);
944 // => undefined
945 ```
946 * * *
947
948 <!-- /div -->
949
950 <!-- div -->
951
952 ### <a id="_indexofarray-value-fromindex0"></a>`_.indexOf(array, value, [fromIndex=0])`
953 <a href="#_indexofarray-value-fromindex0">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L6035 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.indexof "See the npm package")
954
955 Gets the index at which the first occurrence of `value` is found in `array`
956 using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
957 for equality comparisons. If `fromIndex` is negative, it's used as the offset
958 from the end of `array`.
959
960 #### Arguments
961 1. `array` *(Array)*: The array to search.
962 2. `value` *(&#42;)*: The value to search for.
963 3. `[fromIndex=0]` *(number)*: The index to search from.
964
965 #### Returns
966 *(number)*:  Returns the index of the matched value, else `-1`.
967
968 #### Example
969 ```js
970 _.indexOf([1, 2, 1, 2], 2);
971 // => 1
972
973 // Search from the `fromIndex`.
974 _.indexOf([1, 2, 1, 2], 2, 2);
975 // => 3
976 ```
977 * * *
978
979 <!-- /div -->
980
981 <!-- div -->
982
983 ### <a id="_initialarray"></a>`_.initial(array)`
984 <a href="#_initialarray">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L6060 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.initial "See the npm package")
985
986 Gets all but the last element of `array`.
987
988 #### Arguments
989 1. `array` *(Array)*: The array to query.
990
991 #### Returns
992 *(Array)*:  Returns the slice of `array`.
993
994 #### Example
995 ```js
996 _.initial([1, 2, 3]);
997 // => [1, 2]
998 ```
999 * * *
1000
1001 <!-- /div -->
1002
1003 <!-- div -->
1004
1005 ### <a id="_intersectionarrays"></a>`_.intersection([arrays])`
1006 <a href="#_intersectionarrays">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L6079 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.intersection "See the npm package")
1007
1008 Creates an array of unique values that are included in all given arrays
1009 using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
1010 for equality comparisons.
1011
1012 #### Arguments
1013 1. `[arrays]` *(...Array)*: The arrays to inspect.
1014
1015 #### Returns
1016 *(Array)*:  Returns the new array of shared values.
1017
1018 #### Example
1019 ```js
1020 _.intersection([2, 1], [4, 2], [1, 2]);
1021 // => [2]
1022 ```
1023 * * *
1024
1025 <!-- /div -->
1026
1027 <!-- div -->
1028
1029 ### <a id="_intersectionbyarrays-iteratee_identity"></a>`_.intersectionBy([arrays], [iteratee=_.identity])`
1030 <a href="#_intersectionbyarrays-iteratee_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L6106 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.intersectionby "See the npm package")
1031
1032 This method is like `_.intersection` except that it accepts `iteratee`
1033 which is invoked for each element of each `arrays` to generate the criterion
1034 by which uniqueness is computed. The iteratee is invoked with one argument: (value).
1035
1036 #### Arguments
1037 1. `[arrays]` *(...Array)*: The arrays to inspect.
1038 2. `[iteratee=_.identity]` *(Function|Object|string)*: The iteratee invoked per element.
1039
1040 #### Returns
1041 *(Array)*:  Returns the new array of shared values.
1042
1043 #### Example
1044 ```js
1045 _.intersectionBy([2.1, 1.2], [4.3, 2.4], Math.floor);
1046 // => [2.1]
1047
1048 // The `_.property` iteratee shorthand.
1049 _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
1050 // => [{ 'x': 1 }]
1051 ```
1052 * * *
1053
1054 <!-- /div -->
1055
1056 <!-- div -->
1057
1058 ### <a id="_intersectionwitharrays-comparator"></a>`_.intersectionWith([arrays], [comparator])`
1059 <a href="#_intersectionwitharrays-comparator">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L6139 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.intersectionwith "See the npm package")
1060
1061 This method is like `_.intersection` except that it accepts `comparator`
1062 which is invoked to compare elements of `arrays`. The comparator is invoked
1063 with two arguments: (arrVal, othVal).
1064
1065 #### Arguments
1066 1. `[arrays]` *(...Array)*: The arrays to inspect.
1067 2. `[comparator]` *(Function)*: The comparator invoked per element.
1068
1069 #### Returns
1070 *(Array)*:  Returns the new array of shared values.
1071
1072 #### Example
1073 ```js
1074 var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
1075 var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
1076
1077 _.intersectionWith(objects, others, _.isEqual);
1078 // => [{ 'x': 1, 'y': 2 }]
1079 ```
1080 * * *
1081
1082 <!-- /div -->
1083
1084 <!-- div -->
1085
1086 ### <a id="_joinarray-separator-"></a>`_.join(array, [separator=','])`
1087 <a href="#_joinarray-separator-">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L6167 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.join "See the npm package")
1088
1089 Converts all elements in `array` into a string separated by `separator`.
1090
1091 #### Arguments
1092 1. `array` *(Array)*: The array to convert.
1093 2. `[separator=',']` *(string)*: The element separator.
1094
1095 #### Returns
1096 *(string)*:  Returns the joined string.
1097
1098 #### Example
1099 ```js
1100 _.join(['a', 'b', 'c'], '~');
1101 // => 'a~b~c'
1102 ```
1103 * * *
1104
1105 <!-- /div -->
1106
1107 <!-- div -->
1108
1109 ### <a id="_lastarray"></a>`_.last(array)`
1110 <a href="#_lastarray">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L6184 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.last "See the npm package")
1111
1112 Gets the last element of `array`.
1113
1114 #### Arguments
1115 1. `array` *(Array)*: The array to query.
1116
1117 #### Returns
1118 *(&#42;)*:  Returns the last element of `array`.
1119
1120 #### Example
1121 ```js
1122 _.last([1, 2, 3]);
1123 // => 3
1124 ```
1125 * * *
1126
1127 <!-- /div -->
1128
1129 <!-- div -->
1130
1131 ### <a id="_lastindexofarray-value-fromindexarraylength-1"></a>`_.lastIndexOf(array, value, [fromIndex=array.length-1])`
1132 <a href="#_lastindexofarray-value-fromindexarraylength-1">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L6209 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.lastindexof "See the npm package")
1133
1134 This method is like `_.indexOf` except that it iterates over elements of
1135 `array` from right to left.
1136
1137 #### Arguments
1138 1. `array` *(Array)*: The array to search.
1139 2. `value` *(&#42;)*: The value to search for.
1140 3. `[fromIndex=array.length-1]` *(number)*: The index to search from.
1141
1142 #### Returns
1143 *(number)*:  Returns the index of the matched value, else `-1`.
1144
1145 #### Example
1146 ```js
1147 _.lastIndexOf([1, 2, 1, 2], 2);
1148 // => 3
1149
1150 // Search from the `fromIndex`.
1151 _.lastIndexOf([1, 2, 1, 2], 2, 2);
1152 // => 1
1153 ```
1154 * * *
1155
1156 <!-- /div -->
1157
1158 <!-- div -->
1159
1160 ### <a id="_pullarray-values"></a>`_.pull(array, [values])`
1161 <a href="#_pullarray-values">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L6252 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.pull "See the npm package")
1162
1163 Removes all given values from `array` using
1164 [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
1165 for equality comparisons.
1166 <br>
1167 <br>
1168 **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove`
1169 to remove elements from an array by predicate.
1170
1171 #### Arguments
1172 1. `array` *(Array)*: The array to modify.
1173 2. `[values]` *(...&#42;)*: The values to remove.
1174
1175 #### Returns
1176 *(Array)*:  Returns `array`.
1177
1178 #### Example
1179 ```js
1180 var array = [1, 2, 3, 1, 2, 3];
1181
1182 _.pull(array, 2, 3);
1183 console.log(array);
1184 // => [1, 1]
1185 ```
1186 * * *
1187
1188 <!-- /div -->
1189
1190 <!-- div -->
1191
1192 ### <a id="_pullallarray-values"></a>`_.pullAll(array, values)`
1193 <a href="#_pullallarray-values">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L6273 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.pullall "See the npm package")
1194
1195 This method is like `_.pull` except that it accepts an array of values to remove.
1196 <br>
1197 <br>
1198 **Note:** Unlike `_.difference`, this method mutates `array`.
1199
1200 #### Arguments
1201 1. `array` *(Array)*: The array to modify.
1202 2. `values` *(Array)*: The values to remove.
1203
1204 #### Returns
1205 *(Array)*:  Returns `array`.
1206
1207 #### Example
1208 ```js
1209 var array = [1, 2, 3, 1, 2, 3];
1210
1211 _.pullAll(array, [2, 3]);
1212 console.log(array);
1213 // => [1, 1]
1214 ```
1215 * * *
1216
1217 <!-- /div -->
1218
1219 <!-- div -->
1220
1221 ### <a id="_pullallbyarray-values-iteratee_identity"></a>`_.pullAllBy(array, values, [iteratee=_.identity])`
1222 <a href="#_pullallbyarray-values-iteratee_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L6301 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.pullallby "See the npm package")
1223
1224 This method is like `_.pullAll` except that it accepts `iteratee` which is
1225 invoked for each element of `array` and `values` to generate the criterion
1226 by which uniqueness is computed. The iteratee is invoked with one argument: (value).
1227 <br>
1228 <br>
1229 **Note:** Unlike `_.differenceBy`, this method mutates `array`.
1230
1231 #### Arguments
1232 1. `array` *(Array)*: The array to modify.
1233 2. `values` *(Array)*: The values to remove.
1234 3. `[iteratee=_.identity]` *(Function|Object|string)*: The iteratee invoked per element.
1235
1236 #### Returns
1237 *(Array)*:  Returns `array`.
1238
1239 #### Example
1240 ```js
1241 var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];
1242
1243 _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x');
1244 console.log(array);
1245 // => [{ 'x': 2 }]
1246 ```
1247 * * *
1248
1249 <!-- /div -->
1250
1251 <!-- div -->
1252
1253 ### <a id="_pullatarray-indexes"></a>`_.pullAt(array, [indexes])`
1254 <a href="#_pullatarray-indexes">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L6331 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.pullat "See the npm package")
1255
1256 Removes elements from `array` corresponding to `indexes` and returns an
1257 array of removed elements.
1258 <br>
1259 <br>
1260 **Note:** Unlike `_.at`, this method mutates `array`.
1261
1262 #### Arguments
1263 1. `array` *(Array)*: The array to modify.
1264 2. `[indexes]` *(...(number|number&#91;&#93;)*: The indexes of elements to remove, specified individually or in arrays.
1265
1266 #### Returns
1267 *(Array)*:  Returns the new array of removed elements.
1268
1269 #### Example
1270 ```js
1271 var array = [5, 10, 15, 20];
1272 var evens = _.pullAt(array, 1, 3);
1273
1274 console.log(array);
1275 // => [5, 15]
1276
1277 console.log(evens);
1278 // => [10, 20]
1279 ```
1280 * * *
1281
1282 <!-- /div -->
1283
1284 <!-- div -->
1285
1286 ### <a id="_removearray-predicate_identity"></a>`_.remove(array, [predicate=_.identity])`
1287 <a href="#_removearray-predicate_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L6366 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.remove "See the npm package")
1288
1289 Removes all elements from `array` that `predicate` returns truthy for
1290 and returns an array of the removed elements. The predicate is invoked
1291 with three arguments: (value, index, array).
1292 <br>
1293 <br>
1294 **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull`
1295 to pull elements from an array by value.
1296
1297 #### Arguments
1298 1. `array` *(Array)*: The array to modify.
1299 2. `[predicate=_.identity]` *(Function|Object|string)*: The function invoked per iteration.
1300
1301 #### Returns
1302 *(Array)*:  Returns the new array of removed elements.
1303
1304 #### Example
1305 ```js
1306 var array = [1, 2, 3, 4];
1307 var evens = _.remove(array, function(n) {
1308   return n % 2 == 0;
1309 });
1310
1311 console.log(array);
1312 // => [1, 3]
1313
1314 console.log(evens);
1315 // => [2, 4]
1316 ```
1317 * * *
1318
1319 <!-- /div -->
1320
1321 <!-- div -->
1322
1323 ### <a id="_reverse"></a>`_.reverse()`
1324 <a href="#_reverse">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L6408 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.reverse "See the npm package")
1325
1326 Reverses `array` so that the first element becomes the last, the second
1327 element becomes the second to last, and so on.
1328 <br>
1329 <br>
1330 **Note:** This method mutates `array` and is based on
1331 [`Array#reverse`](https://mdn.io/Array/reverse).
1332
1333 #### Returns
1334 *(Array)*:  Returns `array`.
1335
1336 #### Example
1337 ```js
1338 var array = [1, 2, 3];
1339
1340 _.reverse(array);
1341 // => [3, 2, 1]
1342
1343 console.log(array);
1344 // => [3, 2, 1]
1345 ```
1346 * * *
1347
1348 <!-- /div -->
1349
1350 <!-- div -->
1351
1352 ### <a id="_slicearray-start0-endarraylength"></a>`_.slice(array, [start=0], [end=array.length])`
1353 <a href="#_slicearray-start0-endarraylength">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L6426 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.slice "See the npm package")
1354
1355 Creates a slice of `array` from `start` up to, but not including, `end`.
1356 <br>
1357 <br>
1358 **Note:** This method is used instead of [`Array#slice`](https://mdn.io/Array/slice)
1359 to ensure dense arrays are returned.
1360
1361 #### Arguments
1362 1. `array` *(Array)*: The array to slice.
1363 2. `[start=0]` *(number)*: The start position.
1364 3. `[end=array.length]` *(number)*: The end position.
1365
1366 #### Returns
1367 *(Array)*:  Returns the slice of `array`.
1368
1369 * * *
1370
1371 <!-- /div -->
1372
1373 <!-- div -->
1374
1375 ### <a id="_sortedindexarray-value"></a>`_.sortedIndex(array, value)`
1376 <a href="#_sortedindexarray-value">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L6460 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.sortedindex "See the npm package")
1377
1378 Uses a binary search to determine the lowest index at which `value` should
1379 be inserted into `array` in order to maintain its sort order.
1380
1381 #### Arguments
1382 1. `array` *(Array)*: The sorted array to inspect.
1383 2. `value` *(&#42;)*: The value to evaluate.
1384
1385 #### Returns
1386 *(number)*:  Returns the index at which `value` should be inserted into `array`.
1387
1388 #### Example
1389 ```js
1390 _.sortedIndex([30, 50], 40);
1391 // => 1
1392
1393 _.sortedIndex([4, 5], 4);
1394 // => 0
1395 ```
1396 * * *
1397
1398 <!-- /div -->
1399
1400 <!-- div -->
1401
1402 ### <a id="_sortedindexbyarray-value-iteratee_identity"></a>`_.sortedIndexBy(array, value, [iteratee=_.identity])`
1403 <a href="#_sortedindexbyarray-value-iteratee_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L6487 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.sortedindexby "See the npm package")
1404
1405 This method is like `_.sortedIndex` except that it accepts `iteratee`
1406 which is invoked for `value` and each element of `array` to compute their
1407 sort ranking. The iteratee is invoked with one argument: (value).
1408
1409 #### Arguments
1410 1. `array` *(Array)*: The sorted array to inspect.
1411 2. `value` *(&#42;)*: The value to evaluate.
1412 3. `[iteratee=_.identity]` *(Function|Object|string)*: The iteratee invoked per element.
1413
1414 #### Returns
1415 *(number)*:  Returns the index at which `value` should be inserted into `array`.
1416
1417 #### Example
1418 ```js
1419 var dict = { 'thirty': 30, 'forty': 40, 'fifty': 50 };
1420
1421 _.sortedIndexBy(['thirty', 'fifty'], 'forty', _.propertyOf(dict));
1422 // => 1
1423
1424 // The `_.property` iteratee shorthand.
1425 _.sortedIndexBy([{ 'x': 4 }, { 'x': 5 }], { 'x': 4 }, 'x');
1426 // => 0
1427 ```
1428 * * *
1429
1430 <!-- /div -->
1431
1432 <!-- div -->
1433
1434 ### <a id="_sortedindexofarray-value"></a>`_.sortedIndexOf(array, value)`
1435 <a href="#_sortedindexofarray-value">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L6506 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.sortedindexof "See the npm package")
1436
1437 This method is like `_.indexOf` except that it performs a binary
1438 search on a sorted `array`.
1439
1440 #### Arguments
1441 1. `array` *(Array)*: The array to search.
1442 2. `value` *(&#42;)*: The value to search for.
1443
1444 #### Returns
1445 *(number)*:  Returns the index of the matched value, else `-1`.
1446
1447 #### Example
1448 ```js
1449 _.sortedIndexOf([1, 1, 2, 2], 2);
1450 // => 2
1451 ```
1452 * * *
1453
1454 <!-- /div -->
1455
1456 <!-- div -->
1457
1458 ### <a id="_sortedlastindexarray-value"></a>`_.sortedLastIndex(array, value)`
1459 <a href="#_sortedlastindexarray-value">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L6533 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.sortedlastindex "See the npm package")
1460
1461 This method is like `_.sortedIndex` except that it returns the highest
1462 index at which `value` should be inserted into `array` in order to
1463 maintain its sort order.
1464
1465 #### Arguments
1466 1. `array` *(Array)*: The sorted array to inspect.
1467 2. `value` *(&#42;)*: The value to evaluate.
1468
1469 #### Returns
1470 *(number)*:  Returns the index at which `value` should be inserted into `array`.
1471
1472 #### Example
1473 ```js
1474 _.sortedLastIndex([4, 5], 4);
1475 // => 1
1476 ```
1477 * * *
1478
1479 <!-- /div -->
1480
1481 <!-- div -->
1482
1483 ### <a id="_sortedlastindexbyarray-value-iteratee_identity"></a>`_.sortedLastIndexBy(array, value, [iteratee=_.identity])`
1484 <a href="#_sortedlastindexbyarray-value-iteratee_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L6555 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.sortedlastindexby "See the npm package")
1485
1486 This method is like `_.sortedLastIndex` except that it accepts `iteratee`
1487 which is invoked for `value` and each element of `array` to compute their
1488 sort ranking. The iteratee is invoked with one argument: (value).
1489
1490 #### Arguments
1491 1. `array` *(Array)*: The sorted array to inspect.
1492 2. `value` *(&#42;)*: The value to evaluate.
1493 3. `[iteratee=_.identity]` *(Function|Object|string)*: The iteratee invoked per element.
1494
1495 #### Returns
1496 *(number)*:  Returns the index at which `value` should be inserted into `array`.
1497
1498 #### Example
1499 ```js
1500 // The `_.property` iteratee shorthand.
1501 _.sortedLastIndexBy([{ 'x': 4 }, { 'x': 5 }], { 'x': 4 }, 'x');
1502 // => 1
1503 ```
1504 * * *
1505
1506 <!-- /div -->
1507
1508 <!-- div -->
1509
1510 ### <a id="_sortedlastindexofarray-value"></a>`_.sortedLastIndexOf(array, value)`
1511 <a href="#_sortedlastindexofarray-value">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L6574 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.sortedlastindexof "See the npm package")
1512
1513 This method is like `_.lastIndexOf` except that it performs a binary
1514 search on a sorted `array`.
1515
1516 #### Arguments
1517 1. `array` *(Array)*: The array to search.
1518 2. `value` *(&#42;)*: The value to search for.
1519
1520 #### Returns
1521 *(number)*:  Returns the index of the matched value, else `-1`.
1522
1523 #### Example
1524 ```js
1525 _.sortedLastIndexOf([1, 1, 2, 2], 2);
1526 // => 3
1527 ```
1528 * * *
1529
1530 <!-- /div -->
1531
1532 <!-- div -->
1533
1534 ### <a id="_sorteduniqarray"></a>`_.sortedUniq(array)`
1535 <a href="#_sorteduniqarray">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L6599 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.sorteduniq "See the npm package")
1536
1537 This method is like `_.uniq` except that it's designed and optimized
1538 for sorted arrays.
1539
1540 #### Arguments
1541 1. `array` *(Array)*: The array to inspect.
1542
1543 #### Returns
1544 *(Array)*:  Returns the new duplicate free array.
1545
1546 #### Example
1547 ```js
1548 _.sortedUniq([1, 1, 2]);
1549 // => [1, 2]
1550 ```
1551 * * *
1552
1553 <!-- /div -->
1554
1555 <!-- div -->
1556
1557 ### <a id="_sorteduniqbyarray-iteratee"></a>`_.sortedUniqBy(array, [iteratee])`
1558 <a href="#_sorteduniqbyarray-iteratee">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L6620 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.sorteduniqby "See the npm package")
1559
1560 This method is like `_.uniqBy` except that it's designed and optimized
1561 for sorted arrays.
1562
1563 #### Arguments
1564 1. `array` *(Array)*: The array to inspect.
1565 2. `[iteratee]` *(Function)*: The iteratee invoked per element.
1566
1567 #### Returns
1568 *(Array)*:  Returns the new duplicate free array.
1569
1570 #### Example
1571 ```js
1572 _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor);
1573 // => [1.1, 2.3]
1574 ```
1575 * * *
1576
1577 <!-- /div -->
1578
1579 <!-- div -->
1580
1581 ### <a id="_tailarray"></a>`_.tail(array)`
1582 <a href="#_tailarray">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L6639 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.tail "See the npm package")
1583
1584 Gets all but the first element of `array`.
1585
1586 #### Arguments
1587 1. `array` *(Array)*: The array to query.
1588
1589 #### Returns
1590 *(Array)*:  Returns the slice of `array`.
1591
1592 #### Example
1593 ```js
1594 _.tail([1, 2, 3]);
1595 // => [2, 3]
1596 ```
1597 * * *
1598
1599 <!-- /div -->
1600
1601 <!-- div -->
1602
1603 ### <a id="_takearray-n1"></a>`_.take(array, [n=1])`
1604 <a href="#_takearray-n1">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L6667 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.take "See the npm package")
1605
1606 Creates a slice of `array` with `n` elements taken from the beginning.
1607
1608 #### Arguments
1609 1. `array` *(Array)*: The array to query.
1610 2. `[n=1]` *(number)*: The number of elements to take.
1611
1612 #### Returns
1613 *(Array)*:  Returns the slice of `array`.
1614
1615 #### Example
1616 ```js
1617 _.take([1, 2, 3]);
1618 // => [1]
1619
1620 _.take([1, 2, 3], 2);
1621 // => [1, 2]
1622
1623 _.take([1, 2, 3], 5);
1624 // => [1, 2, 3]
1625
1626 _.take([1, 2, 3], 0);
1627 // => []
1628 ```
1629 * * *
1630
1631 <!-- /div -->
1632
1633 <!-- div -->
1634
1635 ### <a id="_takerightarray-n1"></a>`_.takeRight(array, [n=1])`
1636 <a href="#_takerightarray-n1">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L6699 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.takeright "See the npm package")
1637
1638 Creates a slice of `array` with `n` elements taken from the end.
1639
1640 #### Arguments
1641 1. `array` *(Array)*: The array to query.
1642 2. `[n=1]` *(number)*: The number of elements to take.
1643
1644 #### Returns
1645 *(Array)*:  Returns the slice of `array`.
1646
1647 #### Example
1648 ```js
1649 _.takeRight([1, 2, 3]);
1650 // => [3]
1651
1652 _.takeRight([1, 2, 3], 2);
1653 // => [2, 3]
1654
1655 _.takeRight([1, 2, 3], 5);
1656 // => [1, 2, 3]
1657
1658 _.takeRight([1, 2, 3], 0);
1659 // => []
1660 ```
1661 * * *
1662
1663 <!-- /div -->
1664
1665 <!-- div -->
1666
1667 ### <a id="_takerightwhilearray-predicate_identity"></a>`_.takeRightWhile(array, [predicate=_.identity])`
1668 <a href="#_takerightwhilearray-predicate_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L6743 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.takerightwhile "See the npm package")
1669
1670 Creates a slice of `array` with elements taken from the end. Elements are
1671 taken until `predicate` returns falsey. The predicate is invoked with three
1672 arguments: (value, index, array).
1673
1674 #### Arguments
1675 1. `array` *(Array)*: The array to query.
1676 2. `[predicate=_.identity]` *(Function|Object|string)*: The function invoked per iteration.
1677
1678 #### Returns
1679 *(Array)*:  Returns the slice of `array`.
1680
1681 #### Example
1682 ```js
1683 var users = [
1684   { 'user': 'barney',  'active': true },
1685   { 'user': 'fred',    'active': false },
1686   { 'user': 'pebbles', 'active': false }
1687 ];
1688
1689 _.takeRightWhile(users, function(o) { return !o.active; });
1690 // => objects for ['fred', 'pebbles']
1691
1692 // The `_.matches` iteratee shorthand.
1693 _.takeRightWhile(users, { 'user': 'pebbles', 'active': false });
1694 // => objects for ['pebbles']
1695
1696 // The `_.matchesProperty` iteratee shorthand.
1697 _.takeRightWhile(users, ['active', false]);
1698 // => objects for ['fred', 'pebbles']
1699
1700 // The `_.property` iteratee shorthand.
1701 _.takeRightWhile(users, 'active');
1702 // => []
1703 ```
1704 * * *
1705
1706 <!-- /div -->
1707
1708 <!-- div -->
1709
1710 ### <a id="_takewhilearray-predicate_identity"></a>`_.takeWhile(array, [predicate=_.identity])`
1711 <a href="#_takewhilearray-predicate_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L6783 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.takewhile "See the npm package")
1712
1713 Creates a slice of `array` with elements taken from the beginning. Elements
1714 are taken until `predicate` returns falsey. The predicate is invoked with
1715 three arguments: (value, index, array).
1716
1717 #### Arguments
1718 1. `array` *(Array)*: The array to query.
1719 2. `[predicate=_.identity]` *(Function|Object|string)*: The function invoked per iteration.
1720
1721 #### Returns
1722 *(Array)*:  Returns the slice of `array`.
1723
1724 #### Example
1725 ```js
1726 var users = [
1727   { 'user': 'barney',  'active': false },
1728   { 'user': 'fred',    'active': false},
1729   { 'user': 'pebbles', 'active': true }
1730 ];
1731
1732 _.takeWhile(users, function(o) { return !o.active; });
1733 // => objects for ['barney', 'fred']
1734
1735 // The `_.matches` iteratee shorthand.
1736 _.takeWhile(users, { 'user': 'barney', 'active': false });
1737 // => objects for ['barney']
1738
1739 // The `_.matchesProperty` iteratee shorthand.
1740 _.takeWhile(users, ['active', false]);
1741 // => objects for ['barney', 'fred']
1742
1743 // The `_.property` iteratee shorthand.
1744 _.takeWhile(users, 'active');
1745 // => []
1746 ```
1747 * * *
1748
1749 <!-- /div -->
1750
1751 <!-- div -->
1752
1753 ### <a id="_unionarrays"></a>`_.union([arrays])`
1754 <a href="#_unionarrays">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L6804 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.union "See the npm package")
1755
1756 Creates an array of unique values, in order, from all given arrays using
1757 [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
1758 for equality comparisons.
1759
1760 #### Arguments
1761 1. `[arrays]` *(...Array)*: The arrays to inspect.
1762
1763 #### Returns
1764 *(Array)*:  Returns the new array of combined values.
1765
1766 #### Example
1767 ```js
1768 _.union([2, 1], [4, 2], [1, 2]);
1769 // => [2, 1, 4]
1770 ```
1771 * * *
1772
1773 <!-- /div -->
1774
1775 <!-- div -->
1776
1777 ### <a id="_unionbyarrays-iteratee_identity"></a>`_.unionBy([arrays], [iteratee=_.identity])`
1778 <a href="#_unionbyarrays-iteratee_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L6828 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.unionby "See the npm package")
1779
1780 This method is like `_.union` except that it accepts `iteratee` which is
1781 invoked for each element of each `arrays` to generate the criterion by which
1782 uniqueness is computed. The iteratee is invoked with one argument: (value).
1783
1784 #### Arguments
1785 1. `[arrays]` *(...Array)*: The arrays to inspect.
1786 2. `[iteratee=_.identity]` *(Function|Object|string)*: The iteratee invoked per element.
1787
1788 #### Returns
1789 *(Array)*:  Returns the new array of combined values.
1790
1791 #### Example
1792 ```js
1793 _.unionBy([2.1, 1.2], [4.3, 2.4], Math.floor);
1794 // => [2.1, 1.2, 4.3]
1795
1796 // The `_.property` iteratee shorthand.
1797 _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
1798 // => [{ 'x': 1 }, { 'x': 2 }]
1799 ```
1800 * * *
1801
1802 <!-- /div -->
1803
1804 <!-- div -->
1805
1806 ### <a id="_unionwitharrays-comparator"></a>`_.unionWith([arrays], [comparator])`
1807 <a href="#_unionwitharrays-comparator">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L6855 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.unionwith "See the npm package")
1808
1809 This method is like `_.union` except that it accepts `comparator` which
1810 is invoked to compare elements of `arrays`. The comparator is invoked
1811 with two arguments: (arrVal, othVal).
1812
1813 #### Arguments
1814 1. `[arrays]` *(...Array)*: The arrays to inspect.
1815 2. `[comparator]` *(Function)*: The comparator invoked per element.
1816
1817 #### Returns
1818 *(Array)*:  Returns the new array of combined values.
1819
1820 #### Example
1821 ```js
1822 var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
1823 var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
1824
1825 _.unionWith(objects, others, _.isEqual);
1826 // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
1827 ```
1828 * * *
1829
1830 <!-- /div -->
1831
1832 <!-- div -->
1833
1834 ### <a id="_uniqarray"></a>`_.uniq(array)`
1835 <a href="#_uniqarray">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L6879 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.uniq "See the npm package")
1836
1837 Creates a duplicate-free version of an array, using
1838 [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
1839 for equality comparisons, in which only the first occurrence of each element
1840 is kept.
1841
1842 #### Arguments
1843 1. `array` *(Array)*: The array to inspect.
1844
1845 #### Returns
1846 *(Array)*:  Returns the new duplicate free array.
1847
1848 #### Example
1849 ```js
1850 _.uniq([2, 1, 2]);
1851 // => [2, 1]
1852 ```
1853 * * *
1854
1855 <!-- /div -->
1856
1857 <!-- div -->
1858
1859 ### <a id="_uniqbyarray-iteratee_identity"></a>`_.uniqBy(array, [iteratee=_.identity])`
1860 <a href="#_uniqbyarray-iteratee_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L6905 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.uniqby "See the npm package")
1861
1862 This method is like `_.uniq` except that it accepts `iteratee` which is
1863 invoked for each element in `array` to generate the criterion by which
1864 uniqueness is computed. The iteratee is invoked with one argument: (value).
1865
1866 #### Arguments
1867 1. `array` *(Array)*: The array to inspect.
1868 2. `[iteratee=_.identity]` *(Function|Object|string)*: The iteratee invoked per element.
1869
1870 #### Returns
1871 *(Array)*:  Returns the new duplicate free array.
1872
1873 #### Example
1874 ```js
1875 _.uniqBy([2.1, 1.2, 2.3], Math.floor);
1876 // => [2.1, 1.2]
1877
1878 // The `_.property` iteratee shorthand.
1879 _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');
1880 // => [{ 'x': 1 }, { 'x': 2 }]
1881 ```
1882 * * *
1883
1884 <!-- /div -->
1885
1886 <!-- div -->
1887
1888 ### <a id="_uniqwitharray-comparator"></a>`_.uniqWith(array, [comparator])`
1889 <a href="#_uniqwitharray-comparator">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L6929 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.uniqwith "See the npm package")
1890
1891 This method is like `_.uniq` except that it accepts `comparator` which
1892 is invoked to compare elements of `array`. The comparator is invoked with
1893 two arguments: (arrVal, othVal).
1894
1895 #### Arguments
1896 1. `array` *(Array)*: The array to inspect.
1897 2. `[comparator]` *(Function)*: The comparator invoked per element.
1898
1899 #### Returns
1900 *(Array)*:  Returns the new duplicate free array.
1901
1902 #### Example
1903 ```js
1904 var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 },  { 'x': 1, 'y': 2 }];
1905
1906 _.uniqWith(objects, _.isEqual);
1907 // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]
1908 ```
1909 * * *
1910
1911 <!-- /div -->
1912
1913 <!-- div -->
1914
1915 ### <a id="_unziparray"></a>`_.unzip(array)`
1916 <a href="#_unziparray">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L6953 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.unzip "See the npm package")
1917
1918 This method is like `_.zip` except that it accepts an array of grouped
1919 elements and creates an array regrouping the elements to their pre-zip
1920 configuration.
1921
1922 #### Arguments
1923 1. `array` *(Array)*: The array of grouped elements to process.
1924
1925 #### Returns
1926 *(Array)*:  Returns the new array of regrouped elements.
1927
1928 #### Example
1929 ```js
1930 var zipped = _.zip(['fred', 'barney'], [30, 40], [true, false]);
1931 // => [['fred', 30, true], ['barney', 40, false]]
1932
1933 _.unzip(zipped);
1934 // => [['fred', 'barney'], [30, 40], [true, false]]
1935 ```
1936 * * *
1937
1938 <!-- /div -->
1939
1940 <!-- div -->
1941
1942 ### <a id="_unzipwitharray-iteratee_identity"></a>`_.unzipWith(array, [iteratee=_.identity])`
1943 <a href="#_unzipwitharray-iteratee_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L6988 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.unzipwith "See the npm package")
1944
1945 This method is like `_.unzip` except that it accepts `iteratee` to specify
1946 how regrouped values should be combined. The iteratee is invoked with the
1947 elements of each group: (...group).
1948
1949 #### Arguments
1950 1. `array` *(Array)*: The array of grouped elements to process.
1951 2. `[iteratee=_.identity]` *(Function)*: The function to combine regrouped values.
1952
1953 #### Returns
1954 *(Array)*:  Returns the new array of regrouped elements.
1955
1956 #### Example
1957 ```js
1958 var zipped = _.zip([1, 2], [10, 20], [100, 200]);
1959 // => [[1, 10, 100], [2, 20, 200]]
1960
1961 _.unzipWith(zipped, _.add);
1962 // => [3, 30, 300]
1963 ```
1964 * * *
1965
1966 <!-- /div -->
1967
1968 <!-- div -->
1969
1970 ### <a id="_withoutarray-values"></a>`_.without(array, [values])`
1971 <a href="#_withoutarray-values">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L7017 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.without "See the npm package")
1972
1973 Creates an array excluding all given values using
1974 [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
1975 for equality comparisons.
1976
1977 #### Arguments
1978 1. `array` *(Array)*: The array to filter.
1979 2. `[values]` *(...&#42;)*: The values to exclude.
1980
1981 #### Returns
1982 *(Array)*:  Returns the new array of filtered values.
1983
1984 #### Example
1985 ```js
1986 _.without([1, 2, 1, 3], 1, 2);
1987 // => [3]
1988 ```
1989 * * *
1990
1991 <!-- /div -->
1992
1993 <!-- div -->
1994
1995 ### <a id="_xorarrays"></a>`_.xor([arrays])`
1996 <a href="#_xorarrays">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L7037 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.xor "See the npm package")
1997
1998 Creates an array of unique values that is the [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)
1999 of the given arrays.
2000
2001 #### Arguments
2002 1. `[arrays]` *(...Array)*: The arrays to inspect.
2003
2004 #### Returns
2005 *(Array)*:  Returns the new array of values.
2006
2007 #### Example
2008 ```js
2009 _.xor([2, 1], [4, 2]);
2010 // => [1, 4]
2011 ```
2012 * * *
2013
2014 <!-- /div -->
2015
2016 <!-- div -->
2017
2018 ### <a id="_xorbyarrays-iteratee_identity"></a>`_.xorBy([arrays], [iteratee=_.identity])`
2019 <a href="#_xorbyarrays-iteratee_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L7061 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.xorby "See the npm package")
2020
2021 This method is like `_.xor` except that it accepts `iteratee` which is
2022 invoked for each element of each `arrays` to generate the criterion by which
2023 uniqueness is computed. The iteratee is invoked with one argument: (value).
2024
2025 #### Arguments
2026 1. `[arrays]` *(...Array)*: The arrays to inspect.
2027 2. `[iteratee=_.identity]` *(Function|Object|string)*: The iteratee invoked per element.
2028
2029 #### Returns
2030 *(Array)*:  Returns the new array of values.
2031
2032 #### Example
2033 ```js
2034 _.xorBy([2.1, 1.2], [4.3, 2.4], Math.floor);
2035 // => [1.2, 4.3]
2036
2037 // The `_.property` iteratee shorthand.
2038 _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
2039 // => [{ 'x': 2 }]
2040 ```
2041 * * *
2042
2043 <!-- /div -->
2044
2045 <!-- div -->
2046
2047 ### <a id="_xorwitharrays-comparator"></a>`_.xorWith([arrays], [comparator])`
2048 <a href="#_xorwitharrays-comparator">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L7088 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.xorwith "See the npm package")
2049
2050 This method is like `_.xor` except that it accepts `comparator` which is
2051 invoked to compare elements of `arrays`. The comparator is invoked with
2052 two arguments: (arrVal, othVal).
2053
2054 #### Arguments
2055 1. `[arrays]` *(...Array)*: The arrays to inspect.
2056 2. `[comparator]` *(Function)*: The comparator invoked per element.
2057
2058 #### Returns
2059 *(Array)*:  Returns the new array of values.
2060
2061 #### Example
2062 ```js
2063 var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
2064 var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
2065
2066 _.xorWith(objects, others, _.isEqual);
2067 // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
2068 ```
2069 * * *
2070
2071 <!-- /div -->
2072
2073 <!-- div -->
2074
2075 ### <a id="_ziparrays"></a>`_.zip([arrays])`
2076 <a href="#_ziparrays">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L7111 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.zip "See the npm package")
2077
2078 Creates an array of grouped elements, the first of which contains the first
2079 elements of the given arrays, the second of which contains the second elements
2080 of the given arrays, and so on.
2081
2082 #### Arguments
2083 1. `[arrays]` *(...Array)*: The arrays to process.
2084
2085 #### Returns
2086 *(Array)*:  Returns the new array of grouped elements.
2087
2088 #### Example
2089 ```js
2090 _.zip(['fred', 'barney'], [30, 40], [true, false]);
2091 // => [['fred', 30, true], ['barney', 40, false]]
2092 ```
2093 * * *
2094
2095 <!-- /div -->
2096
2097 <!-- div -->
2098
2099 ### <a id="_zipobjectprops-values"></a>`_.zipObject([props=[]], [values=[]])`
2100 <a href="#_zipobjectprops-values">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L7128 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.zipobject "See the npm package")
2101
2102 This method is like `_.fromPairs` except that it accepts two arrays,
2103 one of property names and one of corresponding values.
2104
2105 #### Arguments
2106 1. `[props=[]]` *(Array)*: The property names.
2107 2. `[values=[]]` *(Array)*: The property values.
2108
2109 #### Returns
2110 *(Object)*:  Returns the new object.
2111
2112 #### Example
2113 ```js
2114 _.zipObject(['a', 'b'], [1, 2]);
2115 // => { 'a': 1, 'b': 2 }
2116 ```
2117 * * *
2118
2119 <!-- /div -->
2120
2121 <!-- div -->
2122
2123 ### <a id="_zipobjectdeepprops-values"></a>`_.zipObjectDeep([props=[]], [values=[]])`
2124 <a href="#_zipobjectdeepprops-values">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L7146 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.zipobjectdeep "See the npm package")
2125
2126 This method is like `_.zipObject` except that it supports property paths.
2127
2128 #### Arguments
2129 1. `[props=[]]` *(Array)*: The property names.
2130 2. `[values=[]]` *(Array)*: The property values.
2131
2132 #### Returns
2133 *(Object)*:  Returns the new object.
2134
2135 #### Example
2136 ```js
2137 _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]);
2138 // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } }
2139 ```
2140 * * *
2141
2142 <!-- /div -->
2143
2144 <!-- div -->
2145
2146 ### <a id="_zipwitharrays-iteratee_identity"></a>`_.zipWith([arrays], [iteratee=_.identity])`
2147 <a href="#_zipwitharrays-iteratee_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L7168 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.zipwith "See the npm package")
2148
2149 This method is like `_.zip` except that it accepts `iteratee` to specify
2150 how grouped values should be combined. The iteratee is invoked with the
2151 elements of each group: (...group).
2152
2153 #### Arguments
2154 1. `[arrays]` *(...Array)*: The arrays to process.
2155 2. `[iteratee=_.identity]` *(Function)*: The function to combine grouped values.
2156
2157 #### Returns
2158 *(Array)*:  Returns the new array of grouped elements.
2159
2160 #### Example
2161 ```js
2162 _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) {
2163   return a + b + c;
2164 });
2165 // => [111, 222]
2166 ```
2167 * * *
2168
2169 <!-- /div -->
2170
2171 <!-- /div -->
2172
2173 <!-- div -->
2174
2175 ## `“Collection” Methods`
2176
2177 <!-- div -->
2178
2179 ### <a id="_countbycollection-iteratee_identity"></a>`_.countBy(collection, [iteratee=_.identity])`
2180 <a href="#_countbycollection-iteratee_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L7559 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.countby "See the npm package")
2181
2182 Creates an object composed of keys generated from the results of running
2183 each element of `collection` through `iteratee`. The corresponding value
2184 of each key is the number of times the key was returned by `iteratee`.
2185 The iteratee is invoked with one argument: (value).
2186
2187 #### Arguments
2188 1. `collection` *(Array|Object)*: The collection to iterate over.
2189 2. `[iteratee=_.identity]` *(Function|Object|string)*: The iteratee to transform keys.
2190
2191 #### Returns
2192 *(Object)*:  Returns the composed aggregate object.
2193
2194 #### Example
2195 ```js
2196 _.countBy([6.1, 4.2, 6.3], Math.floor);
2197 // => { '4': 1, '6': 2 }
2198
2199 _.countBy(['one', 'two', 'three'], 'length');
2200 // => { '3': 2, '5': 1 }
2201 ```
2202 * * *
2203
2204 <!-- /div -->
2205
2206 <!-- div -->
2207
2208 ### <a id="_everycollection-predicate_identity"></a>`_.every(collection, [predicate=_.identity])`
2209 <a href="#_everycollection-predicate_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L7597 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.every "See the npm package")
2210
2211 Checks if `predicate` returns truthy for **all** elements of `collection`.
2212 Iteration is stopped once `predicate` returns falsey. The predicate is
2213 invoked with three arguments: (value, index|key, collection).
2214
2215 #### Arguments
2216 1. `collection` *(Array|Object)*: The collection to iterate over.
2217 2. `[predicate=_.identity]` *(Function|Object|string)*: The function invoked per iteration.
2218
2219 #### Returns
2220 *(boolean)*:  Returns `true` if all elements pass the predicate check, else `false`.
2221
2222 #### Example
2223 ```js
2224 _.every([true, 1, null, 'yes'], Boolean);
2225 // => false
2226
2227 var users = [
2228   { 'user': 'barney', 'active': false },
2229   { 'user': 'fred',   'active': false }
2230 ];
2231
2232 // The `_.matches` iteratee shorthand.
2233 _.every(users, { 'user': 'barney', 'active': false });
2234 // => false
2235
2236 // The `_.matchesProperty` iteratee shorthand.
2237 _.every(users, ['active', false]);
2238 // => true
2239
2240 // The `_.property` iteratee shorthand.
2241 _.every(users, 'active');
2242 // => false
2243 ```
2244 * * *
2245
2246 <!-- /div -->
2247
2248 <!-- div -->
2249
2250 ### <a id="_filtercollection-predicate_identity"></a>`_.filter(collection, [predicate=_.identity])`
2251 <a href="#_filtercollection-predicate_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L7638 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.filter "See the npm package")
2252
2253 Iterates over elements of `collection`, returning an array of all elements
2254 `predicate` returns truthy for. The predicate is invoked with three arguments:<br>
2255 (value, index|key, collection).
2256
2257 #### Arguments
2258 1. `collection` *(Array|Object)*: The collection to iterate over.
2259 2. `[predicate=_.identity]` *(Function|Object|string)*: The function invoked per iteration.
2260
2261 #### Returns
2262 *(Array)*:  Returns the new filtered array.
2263
2264 #### Example
2265 ```js
2266 var users = [
2267   { 'user': 'barney', 'age': 36, 'active': true },
2268   { 'user': 'fred',   'age': 40, 'active': false }
2269 ];
2270
2271 _.filter(users, function(o) { return !o.active; });
2272 // => objects for ['fred']
2273
2274 // The `_.matches` iteratee shorthand.
2275 _.filter(users, { 'age': 36, 'active': true });
2276 // => objects for ['barney']
2277
2278 // The `_.matchesProperty` iteratee shorthand.
2279 _.filter(users, ['active', false]);
2280 // => objects for ['fred']
2281
2282 // The `_.property` iteratee shorthand.
2283 _.filter(users, 'active');
2284 // => objects for ['barney']
2285 ```
2286 * * *
2287
2288 <!-- /div -->
2289
2290 <!-- div -->
2291
2292 ### <a id="_findcollection-predicate_identity"></a>`_.find(collection, [predicate=_.identity])`
2293 <a href="#_findcollection-predicate_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L7677 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.find "See the npm package")
2294
2295 Iterates over elements of `collection`, returning the first element
2296 `predicate` returns truthy for. The predicate is invoked with three arguments:<br>
2297 (value, index|key, collection).
2298
2299 #### Arguments
2300 1. `collection` *(Array|Object)*: The collection to search.
2301 2. `[predicate=_.identity]` *(Function|Object|string)*: The function invoked per iteration.
2302
2303 #### Returns
2304 *(&#42;)*:  Returns the matched element, else `undefined`.
2305
2306 #### Example
2307 ```js
2308 var users = [
2309   { 'user': 'barney',  'age': 36, 'active': true },
2310   { 'user': 'fred',    'age': 40, 'active': false },
2311   { 'user': 'pebbles', 'age': 1,  'active': true }
2312 ];
2313
2314 _.find(users, function(o) { return o.age < 40; });
2315 // => object for 'barney'
2316
2317 // The `_.matches` iteratee shorthand.
2318 _.find(users, { 'age': 1, 'active': true });
2319 // => object for 'pebbles'
2320
2321 // The `_.matchesProperty` iteratee shorthand.
2322 _.find(users, ['active', false]);
2323 // => object for 'fred'
2324
2325 // The `_.property` iteratee shorthand.
2326 _.find(users, 'active');
2327 // => object for 'barney'
2328 ```
2329 * * *
2330
2331 <!-- /div -->
2332
2333 <!-- div -->
2334
2335 ### <a id="_findlastcollection-predicate_identity"></a>`_.findLast(collection, [predicate=_.identity])`
2336 <a href="#_findlastcollection-predicate_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L7703 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.findlast "See the npm package")
2337
2338 This method is like `_.find` except that it iterates over elements of
2339 `collection` from right to left.
2340
2341 #### Arguments
2342 1. `collection` *(Array|Object)*: The collection to search.
2343 2. `[predicate=_.identity]` *(Function|Object|string)*: The function invoked per iteration.
2344
2345 #### Returns
2346 *(&#42;)*:  Returns the matched element, else `undefined`.
2347
2348 #### Example
2349 ```js
2350 _.findLast([1, 2, 3, 4], function(n) {
2351   return n % 2 == 1;
2352 });
2353 // => 3
2354 ```
2355 * * *
2356
2357 <!-- /div -->
2358
2359 <!-- div -->
2360
2361 ### <a id="_flatmapcollection-iteratee_identity"></a>`_.flatMap(collection, [iteratee=_.identity])`
2362 <a href="#_flatmapcollection-iteratee_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L7732 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.flatmap "See the npm package")
2363
2364 Creates an array of flattened values by running each element in `collection`
2365 through `iteratee` and concating its result to the other mapped values.
2366 The iteratee is invoked with three arguments: (value, index|key, collection).
2367
2368 #### Arguments
2369 1. `collection` *(Array|Object)*: The collection to iterate over.
2370 2. `[iteratee=_.identity]` *(Function|Object|string)*: The function invoked per iteration.
2371
2372 #### Returns
2373 *(Array)*:  Returns the new flattened array.
2374
2375 #### Example
2376 ```js
2377 function duplicate(n) {
2378   return [n, n];
2379 }
2380
2381 _.flatMap([1, 2], duplicate);
2382 // => [1, 1, 2, 2]
2383 ```
2384 * * *
2385
2386 <!-- /div -->
2387
2388 <!-- div -->
2389
2390 ### <a id="_foreachcollection-iteratee_identity"></a>`_.forEach(collection, [iteratee=_.identity])`
2391 <a href="#_foreachcollection-iteratee_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L7764 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.foreach "See the npm package")
2392
2393 Iterates over elements of `collection` invoking `iteratee` for each element.
2394 The iteratee is invoked with three arguments: (value, index|key, collection).
2395 Iteratee functions may exit iteration early by explicitly returning `false`.
2396 <br>
2397 <br>
2398 **Note:** As with other "Collections" methods, objects with a "length" property
2399 are iterated like arrays. To avoid this behavior use `_.forIn` or `_.forOwn`
2400 for object iteration.
2401
2402 #### Aliases
2403 *_.each*
2404
2405 #### Arguments
2406 1. `collection` *(Array|Object)*: The collection to iterate over.
2407 2. `[iteratee=_.identity]` *(Function)*: The function invoked per iteration.
2408
2409 #### Returns
2410 *(Array|Object)*:  Returns `collection`.
2411
2412 #### Example
2413 ```js
2414 _([1, 2]).forEach(function(value) {
2415   console.log(value);
2416 });
2417 // => logs `1` then `2`
2418
2419 _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {
2420   console.log(key);
2421 });
2422 // => logs 'a' then 'b' (iteration order is not guaranteed)
2423 ```
2424 * * *
2425
2426 <!-- /div -->
2427
2428 <!-- div -->
2429
2430 ### <a id="_foreachrightcollection-iteratee_identity"></a>`_.forEachRight(collection, [iteratee=_.identity])`
2431 <a href="#_foreachrightcollection-iteratee_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L7788 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.foreachright "See the npm package")
2432
2433 This method is like `_.forEach` except that it iterates over elements of
2434 `collection` from right to left.
2435
2436 #### Aliases
2437 *_.eachRight*
2438
2439 #### Arguments
2440 1. `collection` *(Array|Object)*: The collection to iterate over.
2441 2. `[iteratee=_.identity]` *(Function)*: The function invoked per iteration.
2442
2443 #### Returns
2444 *(Array|Object)*:  Returns `collection`.
2445
2446 #### Example
2447 ```js
2448 _.forEachRight([1, 2], function(value) {
2449   console.log(value);
2450 });
2451 // => logs `2` then `1`
2452 ```
2453 * * *
2454
2455 <!-- /div -->
2456
2457 <!-- div -->
2458
2459 ### <a id="_groupbycollection-iteratee_identity"></a>`_.groupBy(collection, [iteratee=_.identity])`
2460 <a href="#_groupbycollection-iteratee_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L7815 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.groupby "See the npm package")
2461
2462 Creates an object composed of keys generated from the results of running
2463 each element of `collection` through `iteratee`. The corresponding value
2464 of each key is an array of elements responsible for generating the key.
2465 The iteratee is invoked with one argument: (value).
2466
2467 #### Arguments
2468 1. `collection` *(Array|Object)*: The collection to iterate over.
2469 2. `[iteratee=_.identity]` *(Function|Object|string)*: The iteratee to transform keys.
2470
2471 #### Returns
2472 *(Object)*:  Returns the composed aggregate object.
2473
2474 #### Example
2475 ```js
2476 _.groupBy([6.1, 4.2, 6.3], Math.floor);
2477 // => { '4': [4.2], '6': [6.1, 6.3] }
2478
2479 // The `_.property` iteratee shorthand.
2480 _.groupBy(['one', 'two', 'three'], 'length');
2481 // => { '3': ['one', 'two'], '5': ['three'] }
2482 ```
2483 * * *
2484
2485 <!-- /div -->
2486
2487 <!-- div -->
2488
2489 ### <a id="_includescollection-value-fromindex0"></a>`_.includes(collection, value, [fromIndex=0])`
2490 <a href="#_includescollection-value-fromindex0">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L7851 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.includes "See the npm package")
2491
2492 Checks if `value` is in `collection`. If `collection` is a string it's checked
2493 for a substring of `value`, otherwise [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
2494 is used for equality comparisons. If `fromIndex` is negative, it's used as
2495 the offset from the end of `collection`.
2496
2497 #### Arguments
2498 1. `collection` *(Array|Object|string)*: The collection to search.
2499 2. `value` *(&#42;)*: The value to search for.
2500 3. `[fromIndex=0]` *(number)*: The index to search from.
2501
2502 #### Returns
2503 *(boolean)*:  Returns `true` if `value` is found, else `false`.
2504
2505 #### Example
2506 ```js
2507 _.includes([1, 2, 3], 1);
2508 // => true
2509
2510 _.includes([1, 2, 3], 1, 2);
2511 // => false
2512
2513 _.includes({ 'user': 'fred', 'age': 40 }, 'fred');
2514 // => true
2515
2516 _.includes('pebbles', 'eb');
2517 // => true
2518 ```
2519 * * *
2520
2521 <!-- /div -->
2522
2523 <!-- div -->
2524
2525 ### <a id="_invokemapcollection-path-args"></a>`_.invokeMap(collection, path, [args])`
2526 <a href="#_invokemapcollection-path-args">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L7886 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.invokemap "See the npm package")
2527
2528 Invokes the method at `path` of each element in `collection`, returning
2529 an array of the results of each invoked method. Any additional arguments
2530 are provided to each invoked method. If `methodName` is a function it's
2531 invoked for, and `this` bound to, each element in `collection`.
2532
2533 #### Arguments
2534 1. `collection` *(Array|Object)*: The collection to iterate over.
2535 2. `path` *(Array|Function|string)*: The path of the method to invoke or the function invoked per iteration.
2536 3. `[args]` *(...&#42;)*: The arguments to invoke each method with.
2537
2538 #### Returns
2539 *(Array)*:  Returns the array of results.
2540
2541 #### Example
2542 ```js
2543 _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort');
2544 // => [[1, 5, 7], [1, 2, 3]]
2545
2546 _.invokeMap([123, 456], String.prototype.split, '');
2547 // => [['1', '2', '3'], ['4', '5', '6']]
2548 ```
2549 * * *
2550
2551 <!-- /div -->
2552
2553 <!-- div -->
2554
2555 ### <a id="_keybycollection-iteratee_identity"></a>`_.keyBy(collection, [iteratee=_.identity])`
2556 <a href="#_keybycollection-iteratee_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L7926 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.keyby "See the npm package")
2557
2558 Creates an object composed of keys generated from the results of running
2559 each element of `collection` through `iteratee`. The corresponding value
2560 of each key is the last element responsible for generating the key. The
2561 iteratee is invoked with one argument: (value).
2562
2563 #### Arguments
2564 1. `collection` *(Array|Object)*: The collection to iterate over.
2565 2. `[iteratee=_.identity]` *(Function|Object|string)*: The iteratee to transform keys.
2566
2567 #### Returns
2568 *(Object)*:  Returns the composed aggregate object.
2569
2570 #### Example
2571 ```js
2572 var array = [
2573   { 'dir': 'left', 'code': 97 },
2574   { 'dir': 'right', 'code': 100 }
2575 ];
2576
2577 _.keyBy(array, function(o) {
2578   return String.fromCharCode(o.code);
2579 });
2580 // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
2581
2582 _.keyBy(array, 'dir');
2583 // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }
2584 ```
2585 * * *
2586
2587 <!-- /div -->
2588
2589 <!-- div -->
2590
2591 ### <a id="_mapcollection-iteratee_identity"></a>`_.map(collection, [iteratee=_.identity])`
2592 <a href="#_mapcollection-iteratee_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L7971 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.map "See the npm package")
2593
2594 Creates an array of values by running each element in `collection` through
2595 `iteratee`. The iteratee is invoked with three arguments:<br>
2596 (value, index|key, collection).
2597 <br>
2598 <br>
2599 Many lodash methods are guarded to work as iteratees for methods like
2600 `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
2601 <br>
2602 <br>
2603 The guarded methods are:<br>
2604 `ary`, `curry`, `curryRight`, `drop`, `dropRight`, `every`, `fill`,
2605 `invert`, `parseInt`, `random`, `range`, `rangeRight`, `slice`, `some`,
2606 `sortBy`, `take`, `takeRight`, `template`, `trim`, `trimEnd`, `trimStart`,
2607 and `words`
2608
2609 #### Arguments
2610 1. `collection` *(Array|Object)*: The collection to iterate over.
2611 2. `[iteratee=_.identity]` *(Function|Object|string)*: The function invoked per iteration.
2612
2613 #### Returns
2614 *(Array)*:  Returns the new mapped array.
2615
2616 #### Example
2617 ```js
2618 function square(n) {
2619   return n * n;
2620 }
2621
2622 _.map([4, 8], square);
2623 // => [16, 64]
2624
2625 _.map({ 'a': 4, 'b': 8 }, square);
2626 // => [16, 64] (iteration order is not guaranteed)
2627
2628 var users = [
2629   { 'user': 'barney' },
2630   { 'user': 'fred' }
2631 ];
2632
2633 // The `_.property` iteratee shorthand.
2634 _.map(users, 'user');
2635 // => ['barney', 'fred']
2636 ```
2637 * * *
2638
2639 <!-- /div -->
2640
2641 <!-- div -->
2642
2643 ### <a id="_orderbycollection-iteratees-_identity-orders"></a>`_.orderBy(collection, [iteratees=[_.identity]], [orders])`
2644 <a href="#_orderbycollection-iteratees-_identity-orders">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L8003 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.orderby "See the npm package")
2645
2646 This method is like `_.sortBy` except that it allows specifying the sort
2647 orders of the iteratees to sort by. If `orders` is unspecified, all values
2648 are sorted in ascending order. Otherwise, specify an order of "desc" for
2649 descending or "asc" for ascending sort order of corresponding values.
2650
2651 #### Arguments
2652 1. `collection` *(Array|Object)*: The collection to iterate over.
2653 2. `[iteratees=[_.identity]]` *(Function&#91;&#93;|Object&#91;&#93;|string&#91;&#93;)*: The iteratees to sort by.
2654 3. `[orders]` *(string&#91;&#93;)*: The sort orders of `iteratees`.
2655
2656 #### Returns
2657 *(Array)*:  Returns the new sorted array.
2658
2659 #### Example
2660 ```js
2661 var users = [
2662   { 'user': 'fred',   'age': 48 },
2663   { 'user': 'barney', 'age': 34 },
2664   { 'user': 'fred',   'age': 42 },
2665   { 'user': 'barney', 'age': 36 }
2666 ];
2667
2668 // Sort by `user` in ascending order and by `age` in descending order.
2669 _.orderBy(users, ['user', 'age'], ['asc', 'desc']);
2670 // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]]
2671 ```
2672 * * *
2673
2674 <!-- /div -->
2675
2676 <!-- div -->
2677
2678 ### <a id="_partitioncollection-predicate_identity"></a>`_.partition(collection, [predicate=_.identity])`
2679 <a href="#_partitioncollection-predicate_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L8052 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.partition "See the npm package")
2680
2681 Creates an array of elements split into two groups, the first of which
2682 contains elements `predicate` returns truthy for, the second of which
2683 contains elements `predicate` returns falsey for. The predicate is
2684 invoked with one argument: (value).
2685
2686 #### Arguments
2687 1. `collection` *(Array|Object)*: The collection to iterate over.
2688 2. `[predicate=_.identity]` *(Function|Object|string)*: The function invoked per iteration.
2689
2690 #### Returns
2691 *(Array)*:  Returns the array of grouped elements.
2692
2693 #### Example
2694 ```js
2695 var users = [
2696   { 'user': 'barney',  'age': 36, 'active': false },
2697   { 'user': 'fred',    'age': 40, 'active': true },
2698   { 'user': 'pebbles', 'age': 1,  'active': false }
2699 ];
2700
2701 _.partition(users, function(o) { return o.active; });
2702 // => objects for [['fred'], ['barney', 'pebbles']]
2703
2704 // The `_.matches` iteratee shorthand.
2705 _.partition(users, { 'age': 1, 'active': false });
2706 // => objects for [['pebbles'], ['barney', 'fred']]
2707
2708 // The `_.matchesProperty` iteratee shorthand.
2709 _.partition(users, ['active', false]);
2710 // => objects for [['barney', 'pebbles'], ['fred']]
2711
2712 // The `_.property` iteratee shorthand.
2713 _.partition(users, 'active');
2714 // => objects for [['fred'], ['barney', 'pebbles']]
2715 ```
2716 * * *
2717
2718 <!-- /div -->
2719
2720 <!-- div -->
2721
2722 ### <a id="_reducecollection-iteratee_identity-accumulator"></a>`_.reduce(collection, [iteratee=_.identity], [accumulator])`
2723 <a href="#_reducecollection-iteratee_identity-accumulator">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L8091 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.reduce "See the npm package")
2724
2725 Reduces `collection` to a value which is the accumulated result of running
2726 each element in `collection` through `iteratee`, where each successive
2727 invocation is supplied the return value of the previous. If `accumulator`
2728 is not given the first element of `collection` is used as the initial
2729 value. The iteratee is invoked with four arguments:<br>
2730 (accumulator, value, index|key, collection).
2731 <br>
2732 <br>
2733 Many lodash methods are guarded to work as iteratees for methods like
2734 `_.reduce`, `_.reduceRight`, and `_.transform`.
2735 <br>
2736 <br>
2737 The guarded methods are:<br>
2738 `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,
2739 and `sortBy`
2740
2741 #### Arguments
2742 1. `collection` *(Array|Object)*: The collection to iterate over.
2743 2. `[iteratee=_.identity]` *(Function)*: The function invoked per iteration.
2744 3. `[accumulator]` *(&#42;)*: The initial value.
2745
2746 #### Returns
2747 *(&#42;)*:  Returns the accumulated value.
2748
2749 #### Example
2750 ```js
2751 _.reduce([1, 2], function(sum, n) {
2752   return sum + n;
2753 }, 0);
2754 // => 3
2755
2756 _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
2757   (result[value] || (result[value] = [])).push(key);
2758   return result;
2759 }, {});
2760 // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)
2761 ```
2762 * * *
2763
2764 <!-- /div -->
2765
2766 <!-- div -->
2767
2768 ### <a id="_reducerightcollection-iteratee_identity-accumulator"></a>`_.reduceRight(collection, [iteratee=_.identity], [accumulator])`
2769 <a href="#_reducerightcollection-iteratee_identity-accumulator">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L8118 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.reduceright "See the npm package")
2770
2771 This method is like `_.reduce` except that it iterates over elements of
2772 `collection` from right to left.
2773
2774 #### Arguments
2775 1. `collection` *(Array|Object)*: The collection to iterate over.
2776 2. `[iteratee=_.identity]` *(Function)*: The function invoked per iteration.
2777 3. `[accumulator]` *(&#42;)*: The initial value.
2778
2779 #### Returns
2780 *(&#42;)*:  Returns the accumulated value.
2781
2782 #### Example
2783 ```js
2784 var array = [[0, 1], [2, 3], [4, 5]];
2785
2786 _.reduceRight(array, function(flattened, other) {
2787   return flattened.concat(other);
2788 }, []);
2789 // => [4, 5, 2, 3, 0, 1]
2790 ```
2791 * * *
2792
2793 <!-- /div -->
2794
2795 <!-- div -->
2796
2797 ### <a id="_rejectcollection-predicate_identity"></a>`_.reject(collection, [predicate=_.identity])`
2798 <a href="#_rejectcollection-predicate_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L8157 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.reject "See the npm package")
2799
2800 The opposite of `_.filter`; this method returns the elements of `collection`
2801 that `predicate` does **not** return truthy for.
2802
2803 #### Arguments
2804 1. `collection` *(Array|Object)*: The collection to iterate over.
2805 2. `[predicate=_.identity]` *(Function|Object|string)*: The function invoked per iteration.
2806
2807 #### Returns
2808 *(Array)*:  Returns the new filtered array.
2809
2810 #### Example
2811 ```js
2812 var users = [
2813   { 'user': 'barney', 'age': 36, 'active': false },
2814   { 'user': 'fred',   'age': 40, 'active': true }
2815 ];
2816
2817 _.reject(users, function(o) { return !o.active; });
2818 // => objects for ['fred']
2819
2820 // The `_.matches` iteratee shorthand.
2821 _.reject(users, { 'age': 40, 'active': true });
2822 // => objects for ['barney']
2823
2824 // The `_.matchesProperty` iteratee shorthand.
2825 _.reject(users, ['active', false]);
2826 // => objects for ['fred']
2827
2828 // The `_.property` iteratee shorthand.
2829 _.reject(users, 'active');
2830 // => objects for ['barney']
2831 ```
2832 * * *
2833
2834 <!-- /div -->
2835
2836 <!-- div -->
2837
2838 ### <a id="_samplecollection"></a>`_.sample(collection)`
2839 <a href="#_samplecollection">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L8178 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.sample "See the npm package")
2840
2841 Gets a random element from `collection`.
2842
2843 #### Arguments
2844 1. `collection` *(Array|Object)*: The collection to sample.
2845
2846 #### Returns
2847 *(&#42;)*:  Returns the random element.
2848
2849 #### Example
2850 ```js
2851 _.sample([1, 2, 3, 4]);
2852 // => 2
2853 ```
2854 * * *
2855
2856 <!-- /div -->
2857
2858 <!-- div -->
2859
2860 ### <a id="_samplesizecollection-n0"></a>`_.sampleSize(collection, [n=0])`
2861 <a href="#_samplesizecollection-n0">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L8203 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.samplesize "See the npm package")
2862
2863 Gets `n` random elements at unique keys from `collection` up to the
2864 size of `collection`.
2865
2866 #### Arguments
2867 1. `collection` *(Array|Object)*: The collection to sample.
2868 2. `[n=0]` *(number)*: The number of elements to sample.
2869
2870 #### Returns
2871 *(Array)*:  Returns the random elements.
2872
2873 #### Example
2874 ```js
2875 _.sampleSize([1, 2, 3], 2);
2876 // => [3, 1]
2877
2878 _.sampleSize([1, 2, 3], 4);
2879 // => [2, 3, 1]
2880 ```
2881 * * *
2882
2883 <!-- /div -->
2884
2885 <!-- div -->
2886
2887 ### <a id="_shufflecollection"></a>`_.shuffle(collection)`
2888 <a href="#_shufflecollection">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L8235 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.shuffle "See the npm package")
2889
2890 Creates an array of shuffled values, using a version of the
2891 [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).
2892
2893 #### Arguments
2894 1. `collection` *(Array|Object)*: The collection to shuffle.
2895
2896 #### Returns
2897 *(Array)*:  Returns the new shuffled array.
2898
2899 #### Example
2900 ```js
2901 _.shuffle([1, 2, 3, 4]);
2902 // => [4, 1, 3, 2]
2903 ```
2904 * * *
2905
2906 <!-- /div -->
2907
2908 <!-- div -->
2909
2910 ### <a id="_sizecollection"></a>`_.size(collection)`
2911 <a href="#_sizecollection">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L8259 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.size "See the npm package")
2912
2913 Gets the size of `collection` by returning its length for array-like
2914 values or the number of own enumerable properties for objects.
2915
2916 #### Arguments
2917 1. `collection` *(Array|Object)*: The collection to inspect.
2918
2919 #### Returns
2920 *(number)*:  Returns the collection size.
2921
2922 #### Example
2923 ```js
2924 _.size([1, 2, 3]);
2925 // => 3
2926
2927 _.size({ 'a': 1, 'b': 2 });
2928 // => 2
2929
2930 _.size('pebbles');
2931 // => 7
2932 ```
2933 * * *
2934
2935 <!-- /div -->
2936
2937 <!-- div -->
2938
2939 ### <a id="_somecollection-predicate_identity"></a>`_.some(collection, [predicate=_.identity])`
2940 <a href="#_somecollection-predicate_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L8304 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.some "See the npm package")
2941
2942 Checks if `predicate` returns truthy for **any** element of `collection`.
2943 Iteration is stopped once `predicate` returns truthy. The predicate is
2944 invoked with three arguments: (value, index|key, collection).
2945
2946 #### Arguments
2947 1. `collection` *(Array|Object)*: The collection to iterate over.
2948 2. `[predicate=_.identity]` *(Function|Object|string)*: The function invoked per iteration.
2949
2950 #### Returns
2951 *(boolean)*:  Returns `true` if any element passes the predicate check, else `false`.
2952
2953 #### Example
2954 ```js
2955 _.some([null, 0, 'yes', false], Boolean);
2956 // => true
2957
2958 var users = [
2959   { 'user': 'barney', 'active': true },
2960   { 'user': 'fred',   'active': false }
2961 ];
2962
2963 // The `_.matches` iteratee shorthand.
2964 _.some(users, { 'user': 'barney', 'active': false });
2965 // => false
2966
2967 // The `_.matchesProperty` iteratee shorthand.
2968 _.some(users, ['active', false]);
2969 // => true
2970
2971 // The `_.property` iteratee shorthand.
2972 _.some(users, 'active');
2973 // => true
2974 ```
2975 * * *
2976
2977 <!-- /div -->
2978
2979 <!-- div -->
2980
2981 ### <a id="_sortbycollection-iteratees-_identity"></a>`_.sortBy(collection, [iteratees=[_.identity]])`
2982 <a href="#_sortbycollection-iteratees-_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L8345 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.sortby "See the npm package")
2983
2984 Creates an array of elements, sorted in ascending order by the results of
2985 running each element in a collection through each iteratee. This method
2986 performs a stable sort, that is, it preserves the original sort order of
2987 equal elements. The iteratees are invoked with one argument: (value).
2988
2989 #### Arguments
2990 1. `collection` *(Array|Object)*: The collection to iterate over.
2991 2. `[iteratees=[_.identity]]` *(...(Function|Function&#91;&#93;|Object|Object&#91;&#93;|string|string&#91;&#93;)*:  The iteratees to sort by, specified individually or in arrays.
2992
2993 #### Returns
2994 *(Array)*:  Returns the new sorted array.
2995
2996 #### Example
2997 ```js
2998 var users = [
2999   { 'user': 'fred',   'age': 48 },
3000   { 'user': 'barney', 'age': 36 },
3001   { 'user': 'fred',   'age': 42 },
3002   { 'user': 'barney', 'age': 34 }
3003 ];
3004
3005 _.sortBy(users, function(o) { return o.user; });
3006 // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]]
3007
3008 _.sortBy(users, ['user', 'age']);
3009 // => objects for [['barney', 34], ['barney', 36], ['fred', 42], ['fred', 48]]
3010
3011 _.sortBy(users, 'user', function(o) {
3012   return Math.floor(o.age / 10);
3013 });
3014 // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]]
3015 ```
3016 * * *
3017
3018 <!-- /div -->
3019
3020 <!-- /div -->
3021
3022 <!-- div -->
3023
3024 ## `“Date” Methods`
3025
3026 <!-- div -->
3027
3028 ### <a id="_now"></a>`_.now()`
3029 <a href="#_now">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L8376 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.now "See the npm package")
3030
3031 ({Function}): Gets the timestamp of the number of milliseconds that have elapsed since
3032 the Unix epoch (1 January 1970 00:00:00 UTC).
3033
3034 #### Returns
3035 *(number)*:  Returns the timestamp.
3036
3037 #### Example
3038 ```js
3039 _.defer(function(stamp) {
3040   console.log(_.now() - stamp);
3041 }, _.now());
3042 // => logs the number of milliseconds it took for the deferred function to be invoked
3043 ```
3044 * * *
3045
3046 <!-- /div -->
3047
3048 <!-- /div -->
3049
3050 <!-- div -->
3051
3052 ## `“Function” Methods`
3053
3054 <!-- div -->
3055
3056 ### <a id="_aftern-func"></a>`_.after(n, func)`
3057 <a href="#_aftern-func">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L8403 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.after "See the npm package")
3058
3059 The opposite of `_.before`; this method creates a function that invokes
3060 `func` once it's called `n` or more times.
3061
3062 #### Arguments
3063 1. `n` *(number)*: The number of calls before `func` is invoked.
3064 2. `func` *(Function)*: The function to restrict.
3065
3066 #### Returns
3067 *(Function)*:  Returns the new restricted function.
3068
3069 #### Example
3070 ```js
3071 var saves = ['profile', 'settings'];
3072
3073 var done = _.after(saves.length, function() {
3074   console.log('done saving!');
3075 });
3076
3077 _.forEach(saves, function(type) {
3078   asyncSave({ 'type': type, 'complete': done });
3079 });
3080 // => logs 'done saving!' after the two async saves have completed
3081 ```
3082 * * *
3083
3084 <!-- /div -->
3085
3086 <!-- div -->
3087
3088 ### <a id="_aryfunc-nfunclength"></a>`_.ary(func, [n=func.length])`
3089 <a href="#_aryfunc-nfunclength">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L8431 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.ary "See the npm package")
3090
3091 Creates a function that accepts up to `n` arguments, ignoring any
3092 additional arguments.
3093
3094 #### Arguments
3095 1. `func` *(Function)*: The function to cap arguments for.
3096 2. `[n=func.length]` *(number)*: The arity cap.
3097
3098 #### Returns
3099 *(Function)*:  Returns the new function.
3100
3101 #### Example
3102 ```js
3103 _.map(['6', '8', '10'], _.ary(parseInt, 1));
3104 // => [6, 8, 10]
3105 ```
3106 * * *
3107
3108 <!-- /div -->
3109
3110 <!-- div -->
3111
3112 ### <a id="_beforen-func"></a>`_.before(n, func)`
3113 <a href="#_beforen-func">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L8453 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.before "See the npm package")
3114
3115 Creates a function that invokes `func`, with the `this` binding and arguments
3116 of the created function, while it's called less than `n` times. Subsequent
3117 calls to the created function return the result of the last `func` invocation.
3118
3119 #### Arguments
3120 1. `n` *(number)*: The number of calls at which `func` is no longer invoked.
3121 2. `func` *(Function)*: The function to restrict.
3122
3123 #### Returns
3124 *(Function)*:  Returns the new restricted function.
3125
3126 #### Example
3127 ```js
3128 jQuery(element).on('click', _.before(5, addContactToList));
3129 // => allows adding up to 4 contacts to the list
3130 ```
3131 * * *
3132
3133 <!-- /div -->
3134
3135 <!-- div -->
3136
3137 ### <a id="_bindfunc-thisarg-partials"></a>`_.bind(func, thisArg, [partials])`
3138 <a href="#_bindfunc-thisarg-partials">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L8505 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.bind "See the npm package")
3139
3140 Creates a function that invokes `func` with the `this` binding of `thisArg`
3141 and prepends any additional `_.bind` arguments to those provided to the
3142 bound function.
3143 <br>
3144 <br>
3145 The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,
3146 may be used as a placeholder for partially applied arguments.
3147 <br>
3148 <br>
3149 **Note:** Unlike native `Function#bind` this method doesn't set the "length"
3150 property of bound functions.
3151
3152 #### Arguments
3153 1. `func` *(Function)*: The function to bind.
3154 2. `thisArg` *(&#42;)*: The `this` binding of `func`.
3155 3. `[partials]` *(...&#42;)*: The arguments to be partially applied.
3156
3157 #### Returns
3158 *(Function)*:  Returns the new bound function.
3159
3160 #### Example
3161 ```js
3162 var greet = function(greeting, punctuation) {
3163   return greeting + ' ' + this.user + punctuation;
3164 };
3165
3166 var object = { 'user': 'fred' };
3167
3168 var bound = _.bind(greet, object, 'hi');
3169 bound('!');
3170 // => 'hi fred!'
3171
3172 // Bound with placeholders.
3173 var bound = _.bind(greet, object, _, '!');
3174 bound('hi');
3175 // => 'hi fred!'
3176 ```
3177 * * *
3178
3179 <!-- /div -->
3180
3181 <!-- div -->
3182
3183 ### <a id="_bindkeyobject-key-partials"></a>`_.bindKey(object, key, [partials])`
3184 <a href="#_bindkeyobject-key-partials">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L8558 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.bindkey "See the npm package")
3185
3186 Creates a function that invokes the method at `object[key]` and prepends
3187 any additional `_.bindKey` arguments to those provided to the bound function.
3188 <br>
3189 <br>
3190 This method differs from `_.bind` by allowing bound functions to reference
3191 methods that may be redefined or don't yet exist.
3192 See [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)
3193 for more details.
3194 <br>
3195 <br>
3196 The `_.bindKey.placeholder` value, which defaults to `_` in monolithic
3197 builds, may be used as a placeholder for partially applied arguments.
3198
3199 #### Arguments
3200 1. `object` *(Object)*: The object to invoke the method on.
3201 2. `key` *(string)*: The key of the method.
3202 3. `[partials]` *(...&#42;)*: The arguments to be partially applied.
3203
3204 #### Returns
3205 *(Function)*:  Returns the new bound function.
3206
3207 #### Example
3208 ```js
3209 var object = {
3210   'user': 'fred',
3211   'greet': function(greeting, punctuation) {
3212     return greeting + ' ' + this.user + punctuation;
3213   }
3214 };
3215
3216 var bound = _.bindKey(object, 'greet', 'hi');
3217 bound('!');
3218 // => 'hi fred!'
3219
3220 object.greet = function(greeting, punctuation) {
3221   return greeting + 'ya ' + this.user + punctuation;
3222 };
3223
3224 bound('!');
3225 // => 'hiya fred!'
3226
3227 // Bound with placeholders.
3228 var bound = _.bindKey(object, 'greet', _, '!');
3229 bound('hi');
3230 // => 'hiya fred!'
3231 ```
3232 * * *
3233
3234 <!-- /div -->
3235
3236 <!-- div -->
3237
3238 ### <a id="_curryfunc-arityfunclength"></a>`_.curry(func, [arity=func.length])`
3239 <a href="#_curryfunc-arityfunclength">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L8607 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.curry "See the npm package")
3240
3241 Creates a function that accepts arguments of `func` and either invokes
3242 `func` returning its result, if at least `arity` number of arguments have
3243 been provided, or returns a function that accepts the remaining `func`
3244 arguments, and so on. The arity of `func` may be specified if `func.length`
3245 is not sufficient.
3246 <br>
3247 <br>
3248 The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,
3249 may be used as a placeholder for provided arguments.
3250 <br>
3251 <br>
3252 **Note:** This method doesn't set the "length" property of curried functions.
3253
3254 #### Arguments
3255 1. `func` *(Function)*: The function to curry.
3256 2. `[arity=func.length]` *(number)*: The arity of `func`.
3257
3258 #### Returns
3259 *(Function)*:  Returns the new curried function.
3260
3261 #### Example
3262 ```js
3263 var abc = function(a, b, c) {
3264   return [a, b, c];
3265 };
3266
3267 var curried = _.curry(abc);
3268
3269 curried(1)(2)(3);
3270 // => [1, 2, 3]
3271
3272 curried(1, 2)(3);
3273 // => [1, 2, 3]
3274
3275 curried(1, 2, 3);
3276 // => [1, 2, 3]
3277
3278 // Curried with placeholders.
3279 curried(1)(_, 3)(2);
3280 // => [1, 2, 3]
3281 ```
3282 * * *
3283
3284 <!-- /div -->
3285
3286 <!-- div -->
3287
3288 ### <a id="_curryrightfunc-arityfunclength"></a>`_.curryRight(func, [arity=func.length])`
3289 <a href="#_curryrightfunc-arityfunclength">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L8651 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.curryright "See the npm package")
3290
3291 This method is like `_.curry` except that arguments are applied to `func`
3292 in the manner of `_.partialRight` instead of `_.partial`.
3293 <br>
3294 <br>
3295 The `_.curryRight.placeholder` value, which defaults to `_` in monolithic
3296 builds, may be used as a placeholder for provided arguments.
3297 <br>
3298 <br>
3299 **Note:** This method doesn't set the "length" property of curried functions.
3300
3301 #### Arguments
3302 1. `func` *(Function)*: The function to curry.
3303 2. `[arity=func.length]` *(number)*: The arity of `func`.
3304
3305 #### Returns
3306 *(Function)*:  Returns the new curried function.
3307
3308 #### Example
3309 ```js
3310 var abc = function(a, b, c) {
3311   return [a, b, c];
3312 };
3313
3314 var curried = _.curryRight(abc);
3315
3316 curried(3)(2)(1);
3317 // => [1, 2, 3]
3318
3319 curried(2, 3)(1);
3320 // => [1, 2, 3]
3321
3322 curried(1, 2, 3);
3323 // => [1, 2, 3]
3324
3325 // Curried with placeholders.
3326 curried(3)(1, _)(2);
3327 // => [1, 2, 3]
3328 ```
3329 * * *
3330
3331 <!-- /div -->
3332
3333 <!-- div -->
3334
3335 ### <a id="_debouncefunc-wait0-options"></a>`_.debounce(func, [wait=0], [options])`
3336 <a href="#_debouncefunc-wait0-options">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L8707 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.debounce "See the npm package")
3337
3338 Creates a debounced function that delays invoking `func` until after `wait`
3339 milliseconds have elapsed since the last time the debounced function was
3340 invoked. The debounced function comes with a `cancel` method to cancel
3341 delayed `func` invocations and a `flush` method to immediately invoke them.
3342 Provide an options object to indicate whether `func` should be invoked on
3343 the leading and/or trailing edge of the `wait` timeout. The `func` is invoked
3344 with the last arguments provided to the debounced function. Subsequent calls
3345 to the debounced function return the result of the last `func` invocation.
3346 <br>
3347 <br>
3348 **Note:** If `leading` and `trailing` options are `true`, `func` is invoked
3349 on the trailing edge of the timeout only if the debounced function is
3350 invoked more than once during the `wait` timeout.
3351 <br>
3352 <br>
3353 See [David Corbacho's article](http://drupalmotion.com/article/debounce-and-throttle-visual-explanation)
3354 for details over the differences between `_.debounce` and `_.throttle`.
3355
3356 #### Arguments
3357 1. `func` *(Function)*: The function to debounce.
3358 2. `[wait=0]` *(number)*: The number of milliseconds to delay.
3359 3. `[options]` *(Object)*: The options object.
3360 4. `[options.leading=false]` *(boolean)*: Specify invoking on the leading edge of the timeout.
3361 5. `[options.maxWait]` *(number)*: The maximum time `func` is allowed to be delayed before it's invoked.
3362 6. `[options.trailing=true]` *(boolean)*: Specify invoking on the trailing edge of the timeout.
3363
3364 #### Returns
3365 *(Function)*:  Returns the new debounced function.
3366
3367 #### Example
3368 ```js
3369 // Avoid costly calculations while the window size is in flux.
3370 jQuery(window).on('resize', _.debounce(calculateLayout, 150));
3371
3372 // Invoke `sendMail` when clicked, debouncing subsequent calls.
3373 jQuery(element).on('click', _.debounce(sendMail, 300, {
3374   'leading': true,
3375   'trailing': false
3376 }));
3377
3378 // Ensure `batchLog` is invoked once after 1 second of debounced calls.
3379 var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
3380 var source = new EventSource('/stream');
3381 jQuery(source).on('message', debounced);
3382
3383 // Cancel the trailing debounced invocation.
3384 jQuery(window).on('popstate', debounced.cancel);
3385 ```
3386 * * *
3387
3388 <!-- /div -->
3389
3390 <!-- div -->
3391
3392 ### <a id="_deferfunc-args"></a>`_.defer(func, [args])`
3393 <a href="#_deferfunc-args">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L8841 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.defer "See the npm package")
3394
3395 Defers invoking the `func` until the current call stack has cleared. Any
3396 additional arguments are provided to `func` when it's invoked.
3397
3398 #### Arguments
3399 1. `func` *(Function)*: The function to defer.
3400 2. `[args]` *(...&#42;)*: The arguments to invoke `func` with.
3401
3402 #### Returns
3403 *(number)*:  Returns the timer id.
3404
3405 #### Example
3406 ```js
3407 _.defer(function(text) {
3408   console.log(text);
3409 }, 'deferred');
3410 // => logs 'deferred' after one or more milliseconds
3411 ```
3412 * * *
3413
3414 <!-- /div -->
3415
3416 <!-- div -->
3417
3418 ### <a id="_delayfunc-wait-args"></a>`_.delay(func, wait, [args])`
3419 <a href="#_delayfunc-wait-args">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L8863 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.delay "See the npm package")
3420
3421 Invokes `func` after `wait` milliseconds. Any additional arguments are
3422 provided to `func` when it's invoked.
3423
3424 #### Arguments
3425 1. `func` *(Function)*: The function to delay.
3426 2. `wait` *(number)*: The number of milliseconds to delay invocation.
3427 3. `[args]` *(...&#42;)*: The arguments to invoke `func` with.
3428
3429 #### Returns
3430 *(number)*:  Returns the timer id.
3431
3432 #### Example
3433 ```js
3434 _.delay(function(text) {
3435   console.log(text);
3436 }, 1000, 'later');
3437 // => logs 'later' after one second
3438 ```
3439 * * *
3440
3441 <!-- /div -->
3442
3443 <!-- div -->
3444
3445 ### <a id="_flipfunc"></a>`_.flip(func)`
3446 <a href="#_flipfunc">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L8884 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.flip "See the npm package")
3447
3448 Creates a function that invokes `func` with arguments reversed.
3449
3450 #### Arguments
3451 1. `func` *(Function)*: The function to flip arguments for.
3452
3453 #### Returns
3454 *(Function)*:  Returns the new function.
3455
3456 #### Example
3457 ```js
3458 var flipped = _.flip(function() {
3459   return _.toArray(arguments);
3460 });
3461
3462 flipped('a', 'b', 'c', 'd');
3463 // => ['d', 'c', 'b', 'a']
3464 ```
3465 * * *
3466
3467 <!-- /div -->
3468
3469 <!-- div -->
3470
3471 ### <a id="_memoizefunc-resolver"></a>`_.memoize(func, [resolver])`
3472 <a href="#_memoizefunc-resolver">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L8930 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.memoize "See the npm package")
3473
3474 Creates a function that memoizes the result of `func`. If `resolver` is
3475 provided it determines the cache key for storing the result based on the
3476 arguments provided to the memoized function. By default, the first argument
3477 provided to the memoized function is used as the map cache key. The `func`
3478 is invoked with the `this` binding of the memoized function.
3479 <br>
3480 <br>
3481 **Note:** The cache is exposed as the `cache` property on the memoized
3482 function. Its creation may be customized by replacing the `_.memoize.Cache`
3483 constructor with one whose instances implement the [`Map`](http://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-map-prototype-object)
3484 method interface of `delete`, `get`, `has`, and `set`.
3485
3486 #### Arguments
3487 1. `func` *(Function)*: The function to have its output memoized.
3488 2. `[resolver]` *(Function)*: The function to resolve the cache key.
3489
3490 #### Returns
3491 *(Function)*:  Returns the new memoizing function.
3492
3493 #### Example
3494 ```js
3495 var object = { 'a': 1, 'b': 2 };
3496 var other = { 'c': 3, 'd': 4 };
3497
3498 var values = _.memoize(_.values);
3499 values(object);
3500 // => [1, 2]
3501
3502 values(other);
3503 // => [3, 4]
3504
3505 object.a = 2;
3506 values(object);
3507 // => [1, 2]
3508
3509 // Modify the result cache.
3510 values.cache.set(object, ['a', 'b']);
3511 values(object);
3512 // => ['a', 'b']
3513
3514 // Replace `_.memoize.Cache`.
3515 _.memoize.Cache = WeakMap;
3516 ```
3517 * * *
3518
3519 <!-- /div -->
3520
3521 <!-- div -->
3522
3523 ### <a id="_negatepredicate"></a>`_.negate(predicate)`
3524 <a href="#_negatepredicate">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L8969 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.negate "See the npm package")
3525
3526 Creates a function that negates the result of the predicate `func`. The
3527 `func` predicate is invoked with the `this` binding and arguments of the
3528 created function.
3529
3530 #### Arguments
3531 1. `predicate` *(Function)*: The predicate to negate.
3532
3533 #### Returns
3534 *(Function)*:  Returns the new function.
3535
3536 #### Example
3537 ```js
3538 function isEven(n) {
3539   return n % 2 == 0;
3540 }
3541
3542 _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));
3543 // => [1, 3, 5]
3544 ```
3545 * * *
3546
3547 <!-- /div -->
3548
3549 <!-- div -->
3550
3551 ### <a id="_oncefunc"></a>`_.once(func)`
3552 <a href="#_oncefunc">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L8995 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.once "See the npm package")
3553
3554 Creates a function that is restricted to invoking `func` once. Repeat calls
3555 to the function return the value of the first invocation. The `func` is
3556 invoked with the `this` binding and arguments of the created function.
3557
3558 #### Arguments
3559 1. `func` *(Function)*: The function to restrict.
3560
3561 #### Returns
3562 *(Function)*:  Returns the new restricted function.
3563
3564 #### Example
3565 ```js
3566 var initialize = _.once(createApplication);
3567 initialize();
3568 initialize();
3569 // `initialize` invokes `createApplication` once
3570 ```
3571 * * *
3572
3573 <!-- /div -->
3574
3575 <!-- div -->
3576
3577 ### <a id="_overargsfunc-transforms"></a>`_.overArgs(func, [transforms])`
3578 <a href="#_overargsfunc-transforms">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L9030 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.overargs "See the npm package")
3579
3580 Creates a function that invokes `func` with arguments transformed by
3581 corresponding `transforms`.
3582
3583 #### Arguments
3584 1. `func` *(Function)*: The function to wrap.
3585 2. `[transforms]` *(...(Function|Function&#91;&#93;)*: The functions to transform arguments, specified individually or in arrays.
3586
3587 #### Returns
3588 *(Function)*:  Returns the new function.
3589
3590 #### Example
3591 ```js
3592 function doubled(n) {
3593   return n * 2;
3594 }
3595
3596 function square(n) {
3597   return n * n;
3598 }
3599
3600 var func = _.overArgs(function(x, y) {
3601   return [x, y];
3602 }, square, doubled);
3603
3604 func(9, 3);
3605 // => [81, 6]
3606
3607 func(10, 5);
3608 // => [100, 10]
3609 ```
3610 * * *
3611
3612 <!-- /div -->
3613
3614 <!-- div -->
3615
3616 ### <a id="_partialfunc-partials"></a>`_.partial(func, [partials])`
3617 <a href="#_partialfunc-partials">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L9077 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.partial "See the npm package")
3618
3619 Creates a function that invokes `func` with `partial` arguments prepended
3620 to those provided to the new function. This method is like `_.bind` except
3621 it does **not** alter the `this` binding.
3622 <br>
3623 <br>
3624 The `_.partial.placeholder` value, which defaults to `_` in monolithic
3625 builds, may be used as a placeholder for partially applied arguments.
3626 <br>
3627 <br>
3628 **Note:** This method doesn't set the "length" property of partially
3629 applied functions.
3630
3631 #### Arguments
3632 1. `func` *(Function)*: The function to partially apply arguments to.
3633 2. `[partials]` *(...&#42;)*: The arguments to be partially applied.
3634
3635 #### Returns
3636 *(Function)*:  Returns the new partially applied function.
3637
3638 #### Example
3639 ```js
3640 var greet = function(greeting, name) {
3641   return greeting + ' ' + name;
3642 };
3643
3644 var sayHelloTo = _.partial(greet, 'hello');
3645 sayHelloTo('fred');
3646 // => 'hello fred'
3647
3648 // Partially applied with placeholders.
3649 var greetFred = _.partial(greet, _, 'fred');
3650 greetFred('hi');
3651 // => 'hi fred'
3652 ```
3653 * * *
3654
3655 <!-- /div -->
3656
3657 <!-- div -->
3658
3659 ### <a id="_partialrightfunc-partials"></a>`_.partialRight(func, [partials])`
3660 <a href="#_partialrightfunc-partials">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L9113 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.partialright "See the npm package")
3661
3662 This method is like `_.partial` except that partially applied arguments
3663 are appended to those provided to the new function.
3664 <br>
3665 <br>
3666 The `_.partialRight.placeholder` value, which defaults to `_` in monolithic
3667 builds, may be used as a placeholder for partially applied arguments.
3668 <br>
3669 <br>
3670 **Note:** This method doesn't set the "length" property of partially
3671 applied functions.
3672
3673 #### Arguments
3674 1. `func` *(Function)*: The function to partially apply arguments to.
3675 2. `[partials]` *(...&#42;)*: The arguments to be partially applied.
3676
3677 #### Returns
3678 *(Function)*:  Returns the new partially applied function.
3679
3680 #### Example
3681 ```js
3682 var greet = function(greeting, name) {
3683   return greeting + ' ' + name;
3684 };
3685
3686 var greetFred = _.partialRight(greet, 'fred');
3687 greetFred('hi');
3688 // => 'hi fred'
3689
3690 // Partially applied with placeholders.
3691 var sayHelloTo = _.partialRight(greet, 'hello', _);
3692 sayHelloTo('fred');
3693 // => 'hello fred'
3694 ```
3695 * * *
3696
3697 <!-- /div -->
3698
3699 <!-- div -->
3700
3701 ### <a id="_reargfunc-indexes"></a>`_.rearg(func, indexes)`
3702 <a href="#_reargfunc-indexes">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L9140 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.rearg "See the npm package")
3703
3704 Creates a function that invokes `func` with arguments arranged according
3705 to the specified indexes where the argument value at the first index is
3706 provided as the first argument, the argument value at the second index is
3707 provided as the second argument, and so on.
3708
3709 #### Arguments
3710 1. `func` *(Function)*: The function to rearrange arguments for.
3711 2. `indexes` *(...(number|number&#91;&#93;)*: The arranged argument indexes, specified individually or in arrays.
3712
3713 #### Returns
3714 *(Function)*:  Returns the new function.
3715
3716 #### Example
3717 ```js
3718 var rearged = _.rearg(function(a, b, c) {
3719   return [a, b, c];
3720 }, 2, 0, 1);
3721
3722 rearged('b', 'c', 'a')
3723 // => ['a', 'b', 'c']
3724 ```
3725 * * *
3726
3727 <!-- /div -->
3728
3729 <!-- div -->
3730
3731 ### <a id="_restfunc-startfunclength-1"></a>`_.rest(func, [start=func.length-1])`
3732 <a href="#_restfunc-startfunclength-1">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L9166 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.rest "See the npm package")
3733
3734 Creates a function that invokes `func` with the `this` binding of the
3735 created function and arguments from `start` and beyond provided as an array.
3736 <br>
3737 <br>
3738 **Note:** This method is based on the [rest parameter](https://mdn.io/rest_parameters).
3739
3740 #### Arguments
3741 1. `func` *(Function)*: The function to apply a rest parameter to.
3742 2. `[start=func.length-1]` *(number)*: The start position of the rest parameter.
3743
3744 #### Returns
3745 *(Function)*:  Returns the new function.
3746
3747 #### Example
3748 ```js
3749 var say = _.rest(function(what, names) {
3750   return what + ' ' + _.initial(names).join(', ') +
3751     (_.size(names) > 1 ? ', & ' : '') + _.last(names);
3752 });
3753
3754 say('hello', 'fred', 'barney', 'pebbles');
3755 // => 'hello fred, barney, & pebbles'
3756 ```
3757 * * *
3758
3759 <!-- /div -->
3760
3761 <!-- div -->
3762
3763 ### <a id="_spreadfunc-start0"></a>`_.spread(func, [start=0])`
3764 <a href="#_spreadfunc-start0">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L9226 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.spread "See the npm package")
3765
3766 Creates a function that invokes `func` with the `this` binding of the created
3767 function and an array of arguments much like [`Function#apply`](https://es5.github.io/#x15.3.4.3).
3768 <br>
3769 <br>
3770 **Note:** This method is based on the [spread operator](https://mdn.io/spread_operator).
3771
3772 #### Arguments
3773 1. `func` *(Function)*: The function to spread arguments over.
3774 2. `[start=0]` *(number)*: The start position of the spread.
3775
3776 #### Returns
3777 *(Function)*:  Returns the new function.
3778
3779 #### Example
3780 ```js
3781 var say = _.spread(function(who, what) {
3782   return who + ' says ' + what;
3783 });
3784
3785 say(['fred', 'hello']);
3786 // => 'fred says hello'
3787
3788 var numbers = Promise.all([
3789   Promise.resolve(40),
3790   Promise.resolve(36)
3791 ]);
3792
3793 numbers.then(_.spread(function(x, y) {
3794   return x + y;
3795 }));
3796 // => a Promise of 76
3797 ```
3798 * * *
3799
3800 <!-- /div -->
3801
3802 <!-- div -->
3803
3804 ### <a id="_throttlefunc-wait0-options"></a>`_.throttle(func, [wait=0], [options])`
3805 <a href="#_throttlefunc-wait0-options">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L9282 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.throttle "See the npm package")
3806
3807 Creates a throttled function that only invokes `func` at most once per
3808 every `wait` milliseconds. The throttled function comes with a `cancel`
3809 method to cancel delayed `func` invocations and a `flush` method to
3810 immediately invoke them. Provide an options object to indicate whether
3811 `func` should be invoked on the leading and/or trailing edge of the `wait`
3812 timeout. The `func` is invoked with the last arguments provided to the
3813 throttled function. Subsequent calls to the throttled function return the
3814 result of the last `func` invocation.
3815 <br>
3816 <br>
3817 **Note:** If `leading` and `trailing` options are `true`, `func` is invoked
3818 on the trailing edge of the timeout only if the throttled function is
3819 invoked more than once during the `wait` timeout.
3820 <br>
3821 <br>
3822 See [David Corbacho's article](http://drupalmotion.com/article/debounce-and-throttle-visual-explanation)
3823 for details over the differences between `_.throttle` and `_.debounce`.
3824
3825 #### Arguments
3826 1. `func` *(Function)*: The function to throttle.
3827 2. `[wait=0]` *(number)*: The number of milliseconds to throttle invocations to.
3828 3. `[options]` *(Object)*: The options object.
3829 4. `[options.leading=true]` *(boolean)*: Specify invoking on the leading edge of the timeout.
3830 5. `[options.trailing=true]` *(boolean)*: Specify invoking on the trailing edge of the timeout.
3831
3832 #### Returns
3833 *(Function)*:  Returns the new throttled function.
3834
3835 #### Example
3836 ```js
3837 // Avoid excessively updating the position while scrolling.
3838 jQuery(window).on('scroll', _.throttle(updatePosition, 100));
3839
3840 // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.
3841 var throttled = _.throttle(renewToken, 300000, { 'trailing': false });
3842 jQuery(element).on('click', throttled);
3843
3844 // Cancel the trailing throttled invocation.
3845 jQuery(window).on('popstate', throttled.cancel);
3846 ```
3847 * * *
3848
3849 <!-- /div -->
3850
3851 <!-- div -->
3852
3853 ### <a id="_unaryfunc"></a>`_.unary(func)`
3854 <a href="#_unaryfunc">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L9314 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.unary "See the npm package")
3855
3856 Creates a function that accepts up to one argument, ignoring any
3857 additional arguments.
3858
3859 #### Arguments
3860 1. `func` *(Function)*: The function to cap arguments for.
3861
3862 #### Returns
3863 *(Function)*:  Returns the new function.
3864
3865 #### Example
3866 ```js
3867 _.map(['6', '8', '10'], _.unary(parseInt));
3868 // => [6, 8, 10]
3869 ```
3870 * * *
3871
3872 <!-- /div -->
3873
3874 <!-- div -->
3875
3876 ### <a id="_wrapvalue-wrapperidentity"></a>`_.wrap(value, [wrapper=identity])`
3877 <a href="#_wrapvalue-wrapperidentity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L9339 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.wrap "See the npm package")
3878
3879 Creates a function that provides `value` to the wrapper function as its
3880 first argument. Any additional arguments provided to the function are
3881 appended to those provided to the wrapper function. The wrapper is invoked
3882 with the `this` binding of the created function.
3883
3884 #### Arguments
3885 1. `value` *(&#42;)*: The value to wrap.
3886 2. `[wrapper=identity]` *(Function)*: The wrapper function.
3887
3888 #### Returns
3889 *(Function)*:  Returns the new function.
3890
3891 #### Example
3892 ```js
3893 var p = _.wrap(_.escape, function(func, text) {
3894   return '<p>' + func(text) + '</p>';
3895 });
3896
3897 p('fred, barney, & pebbles');
3898 // => '<p>fred, barney, &amp; pebbles</p>'
3899 ```
3900 * * *
3901
3902 <!-- /div -->
3903
3904 <!-- /div -->
3905
3906 <!-- div -->
3907
3908 ## `“Lang” Methods`
3909
3910 <!-- div -->
3911
3912 ### <a id="_castarrayvalue"></a>`_.castArray(value)`
3913 <a href="#_castarrayvalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L9378 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.castarray "See the npm package")
3914
3915 Casts `value` as an array if it's not one.
3916
3917 #### Arguments
3918 1. `value` *(&#42;)*: The value to inspect.
3919
3920 #### Returns
3921 *(Array)*:  Returns the cast array.
3922
3923 #### Example
3924 ```js
3925 _.castArray(1);
3926 // => [1]
3927
3928 _.castArray({ 'a': 1 });
3929 // => [{ 'a': 1 }]
3930
3931 _.castArray('abc');
3932 // => ['abc']
3933
3934 _.castArray(null);
3935 // => [null]
3936
3937 _.castArray(undefined);
3938 // => [undefined]
3939
3940 _.castArray();
3941 // => []
3942
3943 var array = [1, 2, 3];
3944 console.log(_.castArray(array) === array);
3945 // => true
3946 ```
3947 * * *
3948
3949 <!-- /div -->
3950
3951 <!-- div -->
3952
3953 ### <a id="_clonevalue"></a>`_.clone(value)`
3954 <a href="#_clonevalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L9410 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.clone "See the npm package")
3955
3956 Creates a shallow clone of `value`.
3957 <br>
3958 <br>
3959 **Note:** This method is loosely based on the
3960 [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)
3961 and supports cloning arrays, array buffers, booleans, date objects, maps,
3962 numbers, `Object` objects, regexes, sets, strings, symbols, and typed
3963 arrays. The own enumerable properties of `arguments` objects are cloned
3964 as plain objects. An empty object is returned for uncloneable values such
3965 as error objects, functions, DOM nodes, and WeakMaps.
3966
3967 #### Arguments
3968 1. `value` *(&#42;)*: The value to clone.
3969
3970 #### Returns
3971 *(&#42;)*:  Returns the cloned value.
3972
3973 #### Example
3974 ```js
3975 var objects = [{ 'a': 1 }, { 'b': 2 }];
3976
3977 var shallow = _.clone(objects);
3978 console.log(shallow[0] === objects[0]);
3979 // => true
3980 ```
3981 * * *
3982
3983 <!-- /div -->
3984
3985 <!-- div -->
3986
3987 ### <a id="_clonedeepvalue"></a>`_.cloneDeep(value)`
3988 <a href="#_clonedeepvalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L9463 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.clonedeep "See the npm package")
3989
3990 This method is like `_.clone` except that it recursively clones `value`.
3991
3992 #### Arguments
3993 1. `value` *(&#42;)*: The value to recursively clone.
3994
3995 #### Returns
3996 *(&#42;)*:  Returns the deep cloned value.
3997
3998 #### Example
3999 ```js
4000 var objects = [{ 'a': 1 }, { 'b': 2 }];
4001
4002 var deep = _.cloneDeep(objects);
4003 console.log(deep[0] === objects[0]);
4004 // => false
4005 ```
4006 * * *
4007
4008 <!-- /div -->
4009
4010 <!-- div -->
4011
4012 ### <a id="_clonedeepwithvalue-customizer"></a>`_.cloneDeepWith(value, [customizer])`
4013 <a href="#_clonedeepwithvalue-customizer">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L9493 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.clonedeepwith "See the npm package")
4014
4015 This method is like `_.cloneWith` except that it recursively clones `value`.
4016
4017 #### Arguments
4018 1. `value` *(&#42;)*: The value to recursively clone.
4019 2. `[customizer]` *(Function)*: The function to customize cloning.
4020
4021 #### Returns
4022 *(&#42;)*:  Returns the deep cloned value.
4023
4024 #### Example
4025 ```js
4026 function customizer(value) {
4027   if (_.isElement(value)) {
4028     return value.cloneNode(true);
4029   }
4030 }
4031
4032 var el = _.cloneDeepWith(document.body, customizer);
4033
4034 console.log(el === document.body);
4035 // => false
4036 console.log(el.nodeName);
4037 // => 'BODY'
4038 console.log(el.childNodes.length);
4039 // => 20
4040 ```
4041 * * *
4042
4043 <!-- /div -->
4044
4045 <!-- div -->
4046
4047 ### <a id="_clonewithvalue-customizer"></a>`_.cloneWith(value, [customizer])`
4048 <a href="#_clonewithvalue-customizer">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L9443 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.clonewith "See the npm package")
4049
4050 This method is like `_.clone` except that it accepts `customizer` which
4051 is invoked to produce the cloned value. If `customizer` returns `undefined`
4052 cloning is handled by the method instead. The `customizer` is invoked with
4053 up to four arguments; (value [, index|key, object, stack]).
4054
4055 #### Arguments
4056 1. `value` *(&#42;)*: The value to clone.
4057 2. `[customizer]` *(Function)*: The function to customize cloning.
4058
4059 #### Returns
4060 *(&#42;)*:  Returns the cloned value.
4061
4062 #### Example
4063 ```js
4064 function customizer(value) {
4065   if (_.isElement(value)) {
4066     return value.cloneNode(false);
4067   }
4068 }
4069
4070 var el = _.cloneWith(document.body, customizer);
4071
4072 console.log(el === document.body);
4073 // => false
4074 console.log(el.nodeName);
4075 // => 'BODY'
4076 console.log(el.childNodes.length);
4077 // => 0
4078 ```
4079 * * *
4080
4081 <!-- /div -->
4082
4083 <!-- div -->
4084
4085 ### <a id="_eqvalue-other"></a>`_.eq(value, other)`
4086 <a href="#_eqvalue-other">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L9527 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.eq "See the npm package")
4087
4088 Performs a [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
4089 comparison between two values to determine if they are equivalent.
4090
4091 #### Arguments
4092 1. `value` *(&#42;)*: The value to compare.
4093 2. `other` *(&#42;)*: The other value to compare.
4094
4095 #### Returns
4096 *(boolean)*:  Returns `true` if the values are equivalent, else `false`.
4097
4098 #### Example
4099 ```js
4100 var object = { 'user': 'fred' };
4101 var other = { 'user': 'fred' };
4102
4103 _.eq(object, object);
4104 // => true
4105
4106 _.eq(object, other);
4107 // => false
4108
4109 _.eq('a', 'a');
4110 // => true
4111
4112 _.eq('a', Object('a'));
4113 // => false
4114
4115 _.eq(NaN, NaN);
4116 // => true
4117 ```
4118 * * *
4119
4120 <!-- /div -->
4121
4122 <!-- div -->
4123
4124 ### <a id="_gtvalue-other"></a>`_.gt(value, other)`
4125 <a href="#_gtvalue-other">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L9551 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.gt "See the npm package")
4126
4127 Checks if `value` is greater than `other`.
4128
4129 #### Arguments
4130 1. `value` *(&#42;)*: The value to compare.
4131 2. `other` *(&#42;)*: The other value to compare.
4132
4133 #### Returns
4134 *(boolean)*:  Returns `true` if `value` is greater than `other`, else `false`.
4135
4136 #### Example
4137 ```js
4138 _.gt(3, 1);
4139 // => true
4140
4141 _.gt(3, 3);
4142 // => false
4143
4144 _.gt(1, 3);
4145 // => false
4146 ```
4147 * * *
4148
4149 <!-- /div -->
4150
4151 <!-- div -->
4152
4153 ### <a id="_gtevalue-other"></a>`_.gte(value, other)`
4154 <a href="#_gtevalue-other">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L9575 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.gte "See the npm package")
4155
4156 Checks if `value` is greater than or equal to `other`.
4157
4158 #### Arguments
4159 1. `value` *(&#42;)*: The value to compare.
4160 2. `other` *(&#42;)*: The other value to compare.
4161
4162 #### Returns
4163 *(boolean)*:  Returns `true` if `value` is greater than or equal to `other`, else `false`.
4164
4165 #### Example
4166 ```js
4167 _.gte(3, 1);
4168 // => true
4169
4170 _.gte(3, 3);
4171 // => true
4172
4173 _.gte(1, 3);
4174 // => false
4175 ```
4176 * * *
4177
4178 <!-- /div -->
4179
4180 <!-- div -->
4181
4182 ### <a id="_isargumentsvalue"></a>`_.isArguments(value)`
4183 <a href="#_isargumentsvalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L9595 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.isarguments "See the npm package")
4184
4185 Checks if `value` is likely an `arguments` object.
4186
4187 #### Arguments
4188 1. `value` *(&#42;)*: The value to check.
4189
4190 #### Returns
4191 *(boolean)*:  Returns `true` if `value` is correctly classified, else `false`.
4192
4193 #### Example
4194 ```js
4195 _.isArguments(function() { return arguments; }());
4196 // => true
4197
4198 _.isArguments([1, 2, 3]);
4199 // => false
4200 ```
4201 * * *
4202
4203 <!-- /div -->
4204
4205 <!-- div -->
4206
4207 ### <a id="_isarrayvalue"></a>`_.isArray(value)`
4208 <a href="#_isarrayvalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L9624 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.isarray "See the npm package")
4209
4210 ({Function}): Checks if `value` is classified as an `Array` object.
4211
4212 #### Arguments
4213 1. `value` *(&#42;)*: The value to check.
4214
4215 #### Returns
4216 *(boolean)*:  Returns `true` if `value` is correctly classified, else `false`.
4217
4218 #### Example
4219 ```js
4220 _.isArray([1, 2, 3]);
4221 // => true
4222
4223 _.isArray(document.body.children);
4224 // => false
4225
4226 _.isArray('abc');
4227 // => false
4228
4229 _.isArray(_.noop);
4230 // => false
4231 ```
4232 * * *
4233
4234 <!-- /div -->
4235
4236 <!-- div -->
4237
4238 ### <a id="_isarraybuffervalue"></a>`_.isArrayBuffer(value)`
4239 <a href="#_isarraybuffervalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L9642 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.isarraybuffer "See the npm package")
4240
4241 Checks if `value` is classified as an `ArrayBuffer` object.
4242
4243 #### Arguments
4244 1. `value` *(&#42;)*: The value to check.
4245
4246 #### Returns
4247 *(boolean)*:  Returns `true` if `value` is correctly classified, else `false`.
4248
4249 #### Example
4250 ```js
4251 _.isArrayBuffer(new ArrayBuffer(2));
4252 // => true
4253
4254 _.isArrayBuffer(new Array(2));
4255 // => false
4256 ```
4257 * * *
4258
4259 <!-- /div -->
4260
4261 <!-- div -->
4262
4263 ### <a id="_isarraylikevalue"></a>`_.isArrayLike(value)`
4264 <a href="#_isarraylikevalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L9670 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.isarraylike "See the npm package")
4265
4266 Checks if `value` is array-like. A value is considered array-like if it's
4267 not a function and has a `value.length` that's an integer greater than or
4268 equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
4269
4270 #### Arguments
4271 1. `value` *(&#42;)*: The value to check.
4272
4273 #### Returns
4274 *(boolean)*:  Returns `true` if `value` is array-like, else `false`.
4275
4276 #### Example
4277 ```js
4278 _.isArrayLike([1, 2, 3]);
4279 // => true
4280
4281 _.isArrayLike(document.body.children);
4282 // => true
4283
4284 _.isArrayLike('abc');
4285 // => true
4286
4287 _.isArrayLike(_.noop);
4288 // => false
4289 ```
4290 * * *
4291
4292 <!-- /div -->
4293
4294 <!-- div -->
4295
4296 ### <a id="_isarraylikeobjectvalue"></a>`_.isArrayLikeObject(value)`
4297 <a href="#_isarraylikeobjectvalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L9698 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.isarraylikeobject "See the npm package")
4298
4299 This method is like `_.isArrayLike` except that it also checks if `value`
4300 is an object.
4301
4302 #### Arguments
4303 1. `value` *(&#42;)*: The value to check.
4304
4305 #### Returns
4306 *(boolean)*:  Returns `true` if `value` is an array-like object, else `false`.
4307
4308 #### Example
4309 ```js
4310 _.isArrayLikeObject([1, 2, 3]);
4311 // => true
4312
4313 _.isArrayLikeObject(document.body.children);
4314 // => true
4315
4316 _.isArrayLikeObject('abc');
4317 // => false
4318
4319 _.isArrayLikeObject(_.noop);
4320 // => false
4321 ```
4322 * * *
4323
4324 <!-- /div -->
4325
4326 <!-- div -->
4327
4328 ### <a id="_isbooleanvalue"></a>`_.isBoolean(value)`
4329 <a href="#_isbooleanvalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L9718 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.isboolean "See the npm package")
4330
4331 Checks if `value` is classified as a boolean primitive or object.
4332
4333 #### Arguments
4334 1. `value` *(&#42;)*: The value to check.
4335
4336 #### Returns
4337 *(boolean)*:  Returns `true` if `value` is correctly classified, else `false`.
4338
4339 #### Example
4340 ```js
4341 _.isBoolean(false);
4342 // => true
4343
4344 _.isBoolean(null);
4345 // => false
4346 ```
4347 * * *
4348
4349 <!-- /div -->
4350
4351 <!-- div -->
4352
4353 ### <a id="_isbuffervalue"></a>`_.isBuffer(value)`
4354 <a href="#_isbuffervalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L9739 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.isbuffer "See the npm package")
4355
4356 Checks if `value` is a buffer.
4357
4358 #### Arguments
4359 1. `value` *(&#42;)*: The value to check.
4360
4361 #### Returns
4362 *(boolean)*:  Returns `true` if `value` is a buffer, else `false`.
4363
4364 #### Example
4365 ```js
4366 _.isBuffer(new Buffer(2));
4367 // => true
4368
4369 _.isBuffer(new Uint8Array(2));
4370 // => false
4371 ```
4372 * * *
4373
4374 <!-- /div -->
4375
4376 <!-- div -->
4377
4378 ### <a id="_isdatevalue"></a>`_.isDate(value)`
4379 <a href="#_isdatevalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L9759 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.isdate "See the npm package")
4380
4381 Checks if `value` is classified as a `Date` object.
4382
4383 #### Arguments
4384 1. `value` *(&#42;)*: The value to check.
4385
4386 #### Returns
4387 *(boolean)*:  Returns `true` if `value` is correctly classified, else `false`.
4388
4389 #### Example
4390 ```js
4391 _.isDate(new Date);
4392 // => true
4393
4394 _.isDate('Mon April 23 2012');
4395 // => false
4396 ```
4397 * * *
4398
4399 <!-- /div -->
4400
4401 <!-- div -->
4402
4403 ### <a id="_iselementvalue"></a>`_.isElement(value)`
4404 <a href="#_iselementvalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L9779 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.iselement "See the npm package")
4405
4406 Checks if `value` is likely a DOM element.
4407
4408 #### Arguments
4409 1. `value` *(&#42;)*: The value to check.
4410
4411 #### Returns
4412 *(boolean)*:  Returns `true` if `value` is a DOM element, else `false`.
4413
4414 #### Example
4415 ```js
4416 _.isElement(document.body);
4417 // => true
4418
4419 _.isElement('<body>');
4420 // => false
4421 ```
4422 * * *
4423
4424 <!-- /div -->
4425
4426 <!-- div -->
4427
4428 ### <a id="_isemptyvalue"></a>`_.isEmpty(value)`
4429 <a href="#_isemptyvalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L9810 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.isempty "See the npm package")
4430
4431 Checks if `value` is empty. A value is considered empty unless it's an
4432 `arguments` object, array, string, or jQuery-like collection with a length
4433 greater than `0` or an object with own enumerable properties.
4434
4435 #### Arguments
4436 1. `value` *(Array|Object|string)*: The value to inspect.
4437
4438 #### Returns
4439 *(boolean)*:  Returns `true` if `value` is empty, else `false`.
4440
4441 #### Example
4442 ```js
4443 _.isEmpty(null);
4444 // => true
4445
4446 _.isEmpty(true);
4447 // => true
4448
4449 _.isEmpty(1);
4450 // => true
4451
4452 _.isEmpty([1, 2, 3]);
4453 // => false
4454
4455 _.isEmpty({ 'a': 1 });
4456 // => false
4457 ```
4458 * * *
4459
4460 <!-- /div -->
4461
4462 <!-- div -->
4463
4464 ### <a id="_isequalvalue-other"></a>`_.isEqual(value, other)`
4465 <a href="#_isequalvalue-other">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L9851 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.isequal "See the npm package")
4466
4467 Performs a deep comparison between two values to determine if they are
4468 equivalent.
4469 <br>
4470 <br>
4471 **Note:** This method supports comparing arrays, array buffers, booleans,
4472 date objects, error objects, maps, numbers, `Object` objects, regexes,
4473 sets, strings, symbols, and typed arrays. `Object` objects are compared
4474 by their own, not inherited, enumerable properties. Functions and DOM
4475 nodes are **not** supported.
4476
4477 #### Arguments
4478 1. `value` *(&#42;)*: The value to compare.
4479 2. `other` *(&#42;)*: The other value to compare.
4480
4481 #### Returns
4482 *(boolean)*:  Returns `true` if the values are equivalent, else `false`.
4483
4484 #### Example
4485 ```js
4486 var object = { 'user': 'fred' };
4487 var other = { 'user': 'fred' };
4488
4489 _.isEqual(object, other);
4490 // => true
4491
4492 object === other;
4493 // => false
4494 ```
4495 * * *
4496
4497 <!-- /div -->
4498
4499 <!-- div -->
4500
4501 ### <a id="_isequalwithvalue-other-customizer"></a>`_.isEqualWith(value, other, [customizer])`
4502 <a href="#_isequalwithvalue-other-customizer">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L9886 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.isequalwith "See the npm package")
4503
4504 This method is like `_.isEqual` except that it accepts `customizer` which
4505 is invoked to compare values. If `customizer` returns `undefined` comparisons
4506 are handled by the method instead. The `customizer` is invoked with up to
4507 six arguments: (objValue, othValue [, index|key, object, other, stack]).
4508
4509 #### Arguments
4510 1. `value` *(&#42;)*: The value to compare.
4511 2. `other` *(&#42;)*: The other value to compare.
4512 3. `[customizer]` *(Function)*: The function to customize comparisons.
4513
4514 #### Returns
4515 *(boolean)*:  Returns `true` if the values are equivalent, else `false`.
4516
4517 #### Example
4518 ```js
4519 function isGreeting(value) {
4520   return /^h(?:i|ello)$/.test(value);
4521 }
4522
4523 function customizer(objValue, othValue) {
4524   if (isGreeting(objValue) && isGreeting(othValue)) {
4525     return true;
4526   }
4527 }
4528
4529 var array = ['hello', 'goodbye'];
4530 var other = ['hi', 'goodbye'];
4531
4532 _.isEqualWith(array, other, customizer);
4533 // => true
4534 ```
4535 * * *
4536
4537 <!-- /div -->
4538
4539 <!-- div -->
4540
4541 ### <a id="_iserrorvalue"></a>`_.isError(value)`
4542 <a href="#_iserrorvalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L9909 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.iserror "See the npm package")
4543
4544 Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,
4545 `SyntaxError`, `TypeError`, or `URIError` object.
4546
4547 #### Arguments
4548 1. `value` *(&#42;)*: The value to check.
4549
4550 #### Returns
4551 *(boolean)*:  Returns `true` if `value` is an error object, else `false`.
4552
4553 #### Example
4554 ```js
4555 _.isError(new Error);
4556 // => true
4557
4558 _.isError(Error);
4559 // => false
4560 ```
4561 * * *
4562
4563 <!-- /div -->
4564
4565 <!-- div -->
4566
4567 ### <a id="_isfinitevalue"></a>`_.isFinite(value)`
4568 <a href="#_isfinitevalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L9941 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.isfinite "See the npm package")
4569
4570 Checks if `value` is a finite primitive number.
4571 <br>
4572 <br>
4573 **Note:** This method is based on [`Number.isFinite`](https://mdn.io/Number/isFinite).
4574
4575 #### Arguments
4576 1. `value` *(&#42;)*: The value to check.
4577
4578 #### Returns
4579 *(boolean)*:  Returns `true` if `value` is a finite number, else `false`.
4580
4581 #### Example
4582 ```js
4583 _.isFinite(3);
4584 // => true
4585
4586 _.isFinite(Number.MAX_VALUE);
4587 // => true
4588
4589 _.isFinite(3.14);
4590 // => true
4591
4592 _.isFinite(Infinity);
4593 // => false
4594 ```
4595 * * *
4596
4597 <!-- /div -->
4598
4599 <!-- div -->
4600
4601 ### <a id="_isfunctionvalue"></a>`_.isFunction(value)`
4602 <a href="#_isfunctionvalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L9961 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.isfunction "See the npm package")
4603
4604 Checks if `value` is classified as a `Function` object.
4605
4606 #### Arguments
4607 1. `value` *(&#42;)*: The value to check.
4608
4609 #### Returns
4610 *(boolean)*:  Returns `true` if `value` is correctly classified, else `false`.
4611
4612 #### Example
4613 ```js
4614 _.isFunction(_);
4615 // => true
4616
4617 _.isFunction(/abc/);
4618 // => false
4619 ```
4620 * * *
4621
4622 <!-- /div -->
4623
4624 <!-- div -->
4625
4626 ### <a id="_isintegervalue"></a>`_.isInteger(value)`
4627 <a href="#_isintegervalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L9993 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.isinteger "See the npm package")
4628
4629 Checks if `value` is an integer.
4630 <br>
4631 <br>
4632 **Note:** This method is based on [`Number.isInteger`](https://mdn.io/Number/isInteger).
4633
4634 #### Arguments
4635 1. `value` *(&#42;)*: The value to check.
4636
4637 #### Returns
4638 *(boolean)*:  Returns `true` if `value` is an integer, else `false`.
4639
4640 #### Example
4641 ```js
4642 _.isInteger(3);
4643 // => true
4644
4645 _.isInteger(Number.MIN_VALUE);
4646 // => false
4647
4648 _.isInteger(Infinity);
4649 // => false
4650
4651 _.isInteger('3');
4652 // => false
4653 ```
4654 * * *
4655
4656 <!-- /div -->
4657
4658 <!-- div -->
4659
4660 ### <a id="_islengthvalue"></a>`_.isLength(value)`
4661 <a href="#_islengthvalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L10021 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.islength "See the npm package")
4662
4663 Checks if `value` is a valid array-like length.
4664 <br>
4665 <br>
4666 **Note:** This function is loosely based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength).
4667
4668 #### Arguments
4669 1. `value` *(&#42;)*: The value to check.
4670
4671 #### Returns
4672 *(boolean)*:  Returns `true` if `value` is a valid length, else `false`.
4673
4674 #### Example
4675 ```js
4676 _.isLength(3);
4677 // => true
4678
4679 _.isLength(Number.MIN_VALUE);
4680 // => false
4681
4682 _.isLength(Infinity);
4683 // => false
4684
4685 _.isLength('3');
4686 // => false
4687 ```
4688 * * *
4689
4690 <!-- /div -->
4691
4692 <!-- div -->
4693
4694 ### <a id="_ismapvalue"></a>`_.isMap(value)`
4695 <a href="#_ismapvalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L10097 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.ismap "See the npm package")
4696
4697 Checks if `value` is classified as a `Map` object.
4698
4699 #### Arguments
4700 1. `value` *(&#42;)*: The value to check.
4701
4702 #### Returns
4703 *(boolean)*:  Returns `true` if `value` is correctly classified, else `false`.
4704
4705 #### Example
4706 ```js
4707 _.isMap(new Map);
4708 // => true
4709
4710 _.isMap(new WeakMap);
4711 // => false
4712 ```
4713 * * *
4714
4715 <!-- /div -->
4716
4717 <!-- div -->
4718
4719 ### <a id="_ismatchobject-source"></a>`_.isMatch(object, source)`
4720 <a href="#_ismatchobject-source">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L10124 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.ismatch "See the npm package")
4721
4722 Performs a partial deep comparison between `object` and `source` to
4723 determine if `object` contains equivalent property values. This method is
4724 equivalent to a `_.matches` function when `source` is partially applied.
4725 <br>
4726 <br>
4727 **Note:** This method supports comparing the same values as `_.isEqual`.
4728
4729 #### Arguments
4730 1. `object` *(Object)*: The object to inspect.
4731 2. `source` *(Object)*: The object of property values to match.
4732
4733 #### Returns
4734 *(boolean)*:  Returns `true` if `object` is a match, else `false`.
4735
4736 #### Example
4737 ```js
4738 var object = { 'user': 'fred', 'age': 40 };
4739
4740 _.isMatch(object, { 'age': 40 });
4741 // => true
4742
4743 _.isMatch(object, { 'age': 36 });
4744 // => false
4745 ```
4746 * * *
4747
4748 <!-- /div -->
4749
4750 <!-- div -->
4751
4752 ### <a id="_ismatchwithobject-source-customizer"></a>`_.isMatchWith(object, source, [customizer])`
4753 <a href="#_ismatchwithobject-source-customizer">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L10159 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.ismatchwith "See the npm package")
4754
4755 This method is like `_.isMatch` except that it accepts `customizer` which
4756 is invoked to compare values. If `customizer` returns `undefined` comparisons
4757 are handled by the method instead. The `customizer` is invoked with five
4758 arguments: (objValue, srcValue, index|key, object, source).
4759
4760 #### Arguments
4761 1. `object` *(Object)*: The object to inspect.
4762 2. `source` *(Object)*: The object of property values to match.
4763 3. `[customizer]` *(Function)*: The function to customize comparisons.
4764
4765 #### Returns
4766 *(boolean)*:  Returns `true` if `object` is a match, else `false`.
4767
4768 #### Example
4769 ```js
4770 function isGreeting(value) {
4771   return /^h(?:i|ello)$/.test(value);
4772 }
4773
4774 function customizer(objValue, srcValue) {
4775   if (isGreeting(objValue) && isGreeting(srcValue)) {
4776     return true;
4777   }
4778 }
4779
4780 var object = { 'greeting': 'hello' };
4781 var source = { 'greeting': 'hi' };
4782
4783 _.isMatchWith(object, source, customizer);
4784 // => true
4785 ```
4786 * * *
4787
4788 <!-- /div -->
4789
4790 <!-- div -->
4791
4792 ### <a id="_isnanvalue"></a>`_.isNaN(value)`
4793 <a href="#_isnanvalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L10189 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.isnan "See the npm package")
4794
4795 Checks if `value` is `NaN`.
4796 <br>
4797 <br>
4798 **Note:** This method is not the same as [`isNaN`](https://es5.github.io/#x15.1.2.4)
4799 which returns `true` for `undefined` and other non-numeric values.
4800
4801 #### Arguments
4802 1. `value` *(&#42;)*: The value to check.
4803
4804 #### Returns
4805 *(boolean)*:  Returns `true` if `value` is `NaN`, else `false`.
4806
4807 #### Example
4808 ```js
4809 _.isNaN(NaN);
4810 // => true
4811
4812 _.isNaN(new Number(NaN));
4813 // => true
4814
4815 isNaN(undefined);
4816 // => true
4817
4818 _.isNaN(undefined);
4819 // => false
4820 ```
4821 * * *
4822
4823 <!-- /div -->
4824
4825 <!-- div -->
4826
4827 ### <a id="_isnativevalue"></a>`_.isNative(value)`
4828 <a href="#_isnativevalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L10211 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.isnative "See the npm package")
4829
4830 Checks if `value` is a native function.
4831
4832 #### Arguments
4833 1. `value` *(&#42;)*: The value to check.
4834
4835 #### Returns
4836 *(boolean)*:  Returns `true` if `value` is a native function, else `false`.
4837
4838 #### Example
4839 ```js
4840 _.isNative(Array.prototype.push);
4841 // => true
4842
4843 _.isNative(_);
4844 // => false
4845 ```
4846 * * *
4847
4848 <!-- /div -->
4849
4850 <!-- div -->
4851
4852 ### <a id="_isnilvalue"></a>`_.isNil(value)`
4853 <a href="#_isnilvalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L10261 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.isnil "See the npm package")
4854
4855 Checks if `value` is `null` or `undefined`.
4856
4857 #### Arguments
4858 1. `value` *(&#42;)*: The value to check.
4859
4860 #### Returns
4861 *(boolean)*:  Returns `true` if `value` is nullish, else `false`.
4862
4863 #### Example
4864 ```js
4865 _.isNil(null);
4866 // => true
4867
4868 _.isNil(void 0);
4869 // => true
4870
4871 _.isNil(NaN);
4872 // => false
4873 ```
4874 * * *
4875
4876 <!-- /div -->
4877
4878 <!-- div -->
4879
4880 ### <a id="_isnullvalue"></a>`_.isNull(value)`
4881 <a href="#_isnullvalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L10238 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.isnull "See the npm package")
4882
4883 Checks if `value` is `null`.
4884
4885 #### Arguments
4886 1. `value` *(&#42;)*: The value to check.
4887
4888 #### Returns
4889 *(boolean)*:  Returns `true` if `value` is `null`, else `false`.
4890
4891 #### Example
4892 ```js
4893 _.isNull(null);
4894 // => true
4895
4896 _.isNull(void 0);
4897 // => false
4898 ```
4899 * * *
4900
4901 <!-- /div -->
4902
4903 <!-- div -->
4904
4905 ### <a id="_isnumbervalue"></a>`_.isNumber(value)`
4906 <a href="#_isnumbervalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L10290 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.isnumber "See the npm package")
4907
4908 Checks if `value` is classified as a `Number` primitive or object.
4909 <br>
4910 <br>
4911 **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are classified
4912 as numbers, use the `_.isFinite` method.
4913
4914 #### Arguments
4915 1. `value` *(&#42;)*: The value to check.
4916
4917 #### Returns
4918 *(boolean)*:  Returns `true` if `value` is correctly classified, else `false`.
4919
4920 #### Example
4921 ```js
4922 _.isNumber(3);
4923 // => true
4924
4925 _.isNumber(Number.MIN_VALUE);
4926 // => true
4927
4928 _.isNumber(Infinity);
4929 // => true
4930
4931 _.isNumber('3');
4932 // => false
4933 ```
4934 * * *
4935
4936 <!-- /div -->
4937
4938 <!-- div -->
4939
4940 ### <a id="_isobjectvalue"></a>`_.isObject(value)`
4941 <a href="#_isobjectvalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L10049 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.isobject "See the npm package")
4942
4943 Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`.
4944 (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
4945
4946 #### Arguments
4947 1. `value` *(&#42;)*: The value to check.
4948
4949 #### Returns
4950 *(boolean)*:  Returns `true` if `value` is an object, else `false`.
4951
4952 #### Example
4953 ```js
4954 _.isObject({});
4955 // => true
4956
4957 _.isObject([1, 2, 3]);
4958 // => true
4959
4960 _.isObject(_.noop);
4961 // => true
4962
4963 _.isObject(null);
4964 // => false
4965 ```
4966 * * *
4967
4968 <!-- /div -->
4969
4970 <!-- div -->
4971
4972 ### <a id="_isobjectlikevalue"></a>`_.isObjectLike(value)`
4973 <a href="#_isobjectlikevalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L10077 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.isobjectlike "See the npm package")
4974
4975 Checks if `value` is object-like. A value is object-like if it's not `null`
4976 and has a `typeof` result of "object".
4977
4978 #### Arguments
4979 1. `value` *(&#42;)*: The value to check.
4980
4981 #### Returns
4982 *(boolean)*:  Returns `true` if `value` is object-like, else `false`.
4983
4984 #### Example
4985 ```js
4986 _.isObjectLike({});
4987 // => true
4988
4989 _.isObjectLike([1, 2, 3]);
4990 // => true
4991
4992 _.isObjectLike(_.noop);
4993 // => false
4994
4995 _.isObjectLike(null);
4996 // => false
4997 ```
4998 * * *
4999
5000 <!-- /div -->
5001
5002 <!-- div -->
5003
5004 ### <a id="_isplainobjectvalue"></a>`_.isPlainObject(value)`
5005 <a href="#_isplainobjectvalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L10322 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.isplainobject "See the npm package")
5006
5007 Checks if `value` is a plain object, that is, an object created by the
5008 `Object` constructor or one with a `[[Prototype]]` of `null`.
5009
5010 #### Arguments
5011 1. `value` *(&#42;)*: The value to check.
5012
5013 #### Returns
5014 *(boolean)*:  Returns `true` if `value` is a plain object, else `false`.
5015
5016 #### Example
5017 ```js
5018 function Foo() {
5019   this.a = 1;
5020 }
5021
5022 _.isPlainObject(new Foo);
5023 // => false
5024
5025 _.isPlainObject([1, 2, 3]);
5026 // => false
5027
5028 _.isPlainObject({ 'x': 0, 'y': 0 });
5029 // => true
5030
5031 _.isPlainObject(Object.create(null));
5032 // => true
5033 ```
5034 * * *
5035
5036 <!-- /div -->
5037
5038 <!-- div -->
5039
5040 ### <a id="_isregexpvalue"></a>`_.isRegExp(value)`
5041 <a href="#_isregexpvalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L10352 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.isregexp "See the npm package")
5042
5043 Checks if `value` is classified as a `RegExp` object.
5044
5045 #### Arguments
5046 1. `value` *(&#42;)*: The value to check.
5047
5048 #### Returns
5049 *(boolean)*:  Returns `true` if `value` is correctly classified, else `false`.
5050
5051 #### Example
5052 ```js
5053 _.isRegExp(/abc/);
5054 // => true
5055
5056 _.isRegExp('/abc/');
5057 // => false
5058 ```
5059 * * *
5060
5061 <!-- /div -->
5062
5063 <!-- div -->
5064
5065 ### <a id="_issafeintegervalue"></a>`_.isSafeInteger(value)`
5066 <a href="#_issafeintegervalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L10381 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.issafeinteger "See the npm package")
5067
5068 Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754
5069 double precision number which isn't the result of a rounded unsafe integer.
5070 <br>
5071 <br>
5072 **Note:** This method is based on [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger).
5073
5074 #### Arguments
5075 1. `value` *(&#42;)*: The value to check.
5076
5077 #### Returns
5078 *(boolean)*:  Returns `true` if `value` is a safe integer, else `false`.
5079
5080 #### Example
5081 ```js
5082 _.isSafeInteger(3);
5083 // => true
5084
5085 _.isSafeInteger(Number.MIN_VALUE);
5086 // => false
5087
5088 _.isSafeInteger(Infinity);
5089 // => false
5090
5091 _.isSafeInteger('3');
5092 // => false
5093 ```
5094 * * *
5095
5096 <!-- /div -->
5097
5098 <!-- div -->
5099
5100 ### <a id="_issetvalue"></a>`_.isSet(value)`
5101 <a href="#_issetvalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L10401 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.isset "See the npm package")
5102
5103 Checks if `value` is classified as a `Set` object.
5104
5105 #### Arguments
5106 1. `value` *(&#42;)*: The value to check.
5107
5108 #### Returns
5109 *(boolean)*:  Returns `true` if `value` is correctly classified, else `false`.
5110
5111 #### Example
5112 ```js
5113 _.isSet(new Set);
5114 // => true
5115
5116 _.isSet(new WeakSet);
5117 // => false
5118 ```
5119 * * *
5120
5121 <!-- /div -->
5122
5123 <!-- div -->
5124
5125 ### <a id="_isstringvalue"></a>`_.isString(value)`
5126 <a href="#_isstringvalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L10421 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.isstring "See the npm package")
5127
5128 Checks if `value` is classified as a `String` primitive or object.
5129
5130 #### Arguments
5131 1. `value` *(&#42;)*: The value to check.
5132
5133 #### Returns
5134 *(boolean)*:  Returns `true` if `value` is correctly classified, else `false`.
5135
5136 #### Example
5137 ```js
5138 _.isString('abc');
5139 // => true
5140
5141 _.isString(1);
5142 // => false
5143 ```
5144 * * *
5145
5146 <!-- /div -->
5147
5148 <!-- div -->
5149
5150 ### <a id="_issymbolvalue"></a>`_.isSymbol(value)`
5151 <a href="#_issymbolvalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L10442 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.issymbol "See the npm package")
5152
5153 Checks if `value` is classified as a `Symbol` primitive or object.
5154
5155 #### Arguments
5156 1. `value` *(&#42;)*: The value to check.
5157
5158 #### Returns
5159 *(boolean)*:  Returns `true` if `value` is correctly classified, else `false`.
5160
5161 #### Example
5162 ```js
5163 _.isSymbol(Symbol.iterator);
5164 // => true
5165
5166 _.isSymbol('abc');
5167 // => false
5168 ```
5169 * * *
5170
5171 <!-- /div -->
5172
5173 <!-- div -->
5174
5175 ### <a id="_istypedarrayvalue"></a>`_.isTypedArray(value)`
5176 <a href="#_istypedarrayvalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L10463 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.istypedarray "See the npm package")
5177
5178 Checks if `value` is classified as a typed array.
5179
5180 #### Arguments
5181 1. `value` *(&#42;)*: The value to check.
5182
5183 #### Returns
5184 *(boolean)*:  Returns `true` if `value` is correctly classified, else `false`.
5185
5186 #### Example
5187 ```js
5188 _.isTypedArray(new Uint8Array);
5189 // => true
5190
5191 _.isTypedArray([]);
5192 // => false
5193 ```
5194 * * *
5195
5196 <!-- /div -->
5197
5198 <!-- div -->
5199
5200 ### <a id="_isundefinedvalue"></a>`_.isUndefined(value)`
5201 <a href="#_isundefinedvalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L10484 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.isundefined "See the npm package")
5202
5203 Checks if `value` is `undefined`.
5204
5205 #### Arguments
5206 1. `value` *(&#42;)*: The value to check.
5207
5208 #### Returns
5209 *(boolean)*:  Returns `true` if `value` is `undefined`, else `false`.
5210
5211 #### Example
5212 ```js
5213 _.isUndefined(void 0);
5214 // => true
5215
5216 _.isUndefined(null);
5217 // => false
5218 ```
5219 * * *
5220
5221 <!-- /div -->
5222
5223 <!-- div -->
5224
5225 ### <a id="_isweakmapvalue"></a>`_.isWeakMap(value)`
5226 <a href="#_isweakmapvalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L10504 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.isweakmap "See the npm package")
5227
5228 Checks if `value` is classified as a `WeakMap` object.
5229
5230 #### Arguments
5231 1. `value` *(&#42;)*: The value to check.
5232
5233 #### Returns
5234 *(boolean)*:  Returns `true` if `value` is correctly classified, else `false`.
5235
5236 #### Example
5237 ```js
5238 _.isWeakMap(new WeakMap);
5239 // => true
5240
5241 _.isWeakMap(new Map);
5242 // => false
5243 ```
5244 * * *
5245
5246 <!-- /div -->
5247
5248 <!-- div -->
5249
5250 ### <a id="_isweaksetvalue"></a>`_.isWeakSet(value)`
5251 <a href="#_isweaksetvalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L10524 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.isweakset "See the npm package")
5252
5253 Checks if `value` is classified as a `WeakSet` object.
5254
5255 #### Arguments
5256 1. `value` *(&#42;)*: The value to check.
5257
5258 #### Returns
5259 *(boolean)*:  Returns `true` if `value` is correctly classified, else `false`.
5260
5261 #### Example
5262 ```js
5263 _.isWeakSet(new WeakSet);
5264 // => true
5265
5266 _.isWeakSet(new Set);
5267 // => false
5268 ```
5269 * * *
5270
5271 <!-- /div -->
5272
5273 <!-- div -->
5274
5275 ### <a id="_ltvalue-other"></a>`_.lt(value, other)`
5276 <a href="#_ltvalue-other">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L10548 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.lt "See the npm package")
5277
5278 Checks if `value` is less than `other`.
5279
5280 #### Arguments
5281 1. `value` *(&#42;)*: The value to compare.
5282 2. `other` *(&#42;)*: The other value to compare.
5283
5284 #### Returns
5285 *(boolean)*:  Returns `true` if `value` is less than `other`, else `false`.
5286
5287 #### Example
5288 ```js
5289 _.lt(1, 3);
5290 // => true
5291
5292 _.lt(3, 3);
5293 // => false
5294
5295 _.lt(3, 1);
5296 // => false
5297 ```
5298 * * *
5299
5300 <!-- /div -->
5301
5302 <!-- div -->
5303
5304 ### <a id="_ltevalue-other"></a>`_.lte(value, other)`
5305 <a href="#_ltevalue-other">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L10572 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.lte "See the npm package")
5306
5307 Checks if `value` is less than or equal to `other`.
5308
5309 #### Arguments
5310 1. `value` *(&#42;)*: The value to compare.
5311 2. `other` *(&#42;)*: The other value to compare.
5312
5313 #### Returns
5314 *(boolean)*:  Returns `true` if `value` is less than or equal to `other`, else `false`.
5315
5316 #### Example
5317 ```js
5318 _.lte(1, 3);
5319 // => true
5320
5321 _.lte(3, 3);
5322 // => true
5323
5324 _.lte(3, 1);
5325 // => false
5326 ```
5327 * * *
5328
5329 <!-- /div -->
5330
5331 <!-- div -->
5332
5333 ### <a id="_toarrayvalue"></a>`_.toArray(value)`
5334 <a href="#_toarrayvalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L10598 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.toarray "See the npm package")
5335
5336 Converts `value` to an array.
5337
5338 #### Arguments
5339 1. `value` *(&#42;)*: The value to convert.
5340
5341 #### Returns
5342 *(Array)*:  Returns the converted array.
5343
5344 #### Example
5345 ```js
5346 _.toArray({ 'a': 1, 'b': 2 });
5347 // => [1, 2]
5348
5349 _.toArray('abc');
5350 // => ['a', 'b', 'c']
5351
5352 _.toArray(1);
5353 // => []
5354
5355 _.toArray(null);
5356 // => []
5357 ```
5358 * * *
5359
5360 <!-- /div -->
5361
5362 <!-- div -->
5363
5364 ### <a id="_tointegervalue"></a>`_.toInteger(value)`
5365 <a href="#_tointegervalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L10638 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.tointeger "See the npm package")
5366
5367 Converts `value` to an integer.
5368 <br>
5369 <br>
5370 **Note:** This function is loosely based on [`ToInteger`](http://www.ecma-international.org/ecma-262/6.0/#sec-tointeger).
5371
5372 #### Arguments
5373 1. `value` *(&#42;)*: The value to convert.
5374
5375 #### Returns
5376 *(number)*:  Returns the converted integer.
5377
5378 #### Example
5379 ```js
5380 _.toInteger(3);
5381 // => 3
5382
5383 _.toInteger(Number.MIN_VALUE);
5384 // => 0
5385
5386 _.toInteger(Infinity);
5387 // => 1.7976931348623157e+308
5388
5389 _.toInteger('3');
5390 // => 3
5391 ```
5392 * * *
5393
5394 <!-- /div -->
5395
5396 <!-- div -->
5397
5398 ### <a id="_tolengthvalue"></a>`_.toLength(value)`
5399 <a href="#_tolengthvalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L10676 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.tolength "See the npm package")
5400
5401 Converts `value` to an integer suitable for use as the length of an
5402 array-like object.
5403 <br>
5404 <br>
5405 **Note:** This method is based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength).
5406
5407 #### Arguments
5408 1. `value` *(&#42;)*: The value to convert.
5409
5410 #### Returns
5411 *(number)*:  Returns the converted integer.
5412
5413 #### Example
5414 ```js
5415 _.toLength(3);
5416 // => 3
5417
5418 _.toLength(Number.MIN_VALUE);
5419 // => 0
5420
5421 _.toLength(Infinity);
5422 // => 4294967295
5423
5424 _.toLength('3');
5425 // => 3
5426 ```
5427 * * *
5428
5429 <!-- /div -->
5430
5431 <!-- div -->
5432
5433 ### <a id="_tonumbervalue"></a>`_.toNumber(value)`
5434 <a href="#_tonumbervalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L10702 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.tonumber "See the npm package")
5435
5436 Converts `value` to a number.
5437
5438 #### Arguments
5439 1. `value` *(&#42;)*: The value to process.
5440
5441 #### Returns
5442 *(number)*:  Returns the number.
5443
5444 #### Example
5445 ```js
5446 _.toNumber(3);
5447 // => 3
5448
5449 _.toNumber(Number.MIN_VALUE);
5450 // => 5e-324
5451
5452 _.toNumber(Infinity);
5453 // => Infinity
5454
5455 _.toNumber('3');
5456 // => 3
5457 ```
5458 * * *
5459
5460 <!-- /div -->
5461
5462 <!-- div -->
5463
5464 ### <a id="_toplainobjectvalue"></a>`_.toPlainObject(value)`
5465 <a href="#_toplainobjectvalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L10740 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.toplainobject "See the npm package")
5466
5467 Converts `value` to a plain object flattening inherited enumerable
5468 properties of `value` to own properties of the plain object.
5469
5470 #### Arguments
5471 1. `value` *(&#42;)*: The value to convert.
5472
5473 #### Returns
5474 *(Object)*:  Returns the converted plain object.
5475
5476 #### Example
5477 ```js
5478 function Foo() {
5479   this.b = 2;
5480 }
5481
5482 Foo.prototype.c = 3;
5483
5484 _.assign({ 'a': 1 }, new Foo);
5485 // => { 'a': 1, 'b': 2 }
5486
5487 _.assign({ 'a': 1 }, _.toPlainObject(new Foo));
5488 // => { 'a': 1, 'b': 2, 'c': 3 }
5489 ```
5490 * * *
5491
5492 <!-- /div -->
5493
5494 <!-- div -->
5495
5496 ### <a id="_tosafeintegervalue"></a>`_.toSafeInteger(value)`
5497 <a href="#_tosafeintegervalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L10767 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.tosafeinteger "See the npm package")
5498
5499 Converts `value` to a safe integer. A safe integer can be compared and
5500 represented correctly.
5501
5502 #### Arguments
5503 1. `value` *(&#42;)*: The value to convert.
5504
5505 #### Returns
5506 *(number)*:  Returns the converted integer.
5507
5508 #### Example
5509 ```js
5510 _.toSafeInteger(3);
5511 // => 3
5512
5513 _.toSafeInteger(Number.MIN_VALUE);
5514 // => 0
5515
5516 _.toSafeInteger(Infinity);
5517 // => 9007199254740991
5518
5519 _.toSafeInteger('3');
5520 // => 3
5521 ```
5522 * * *
5523
5524 <!-- /div -->
5525
5526 <!-- div -->
5527
5528 ### <a id="_tostringvalue"></a>`_.toString(value)`
5529 <a href="#_tostringvalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L10791 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.tostring "See the npm package")
5530
5531 Converts `value` to a string if it's not one. An empty string is returned
5532 for `null` and `undefined` values. The sign of `-0` is preserved.
5533
5534 #### Arguments
5535 1. `value` *(&#42;)*: The value to process.
5536
5537 #### Returns
5538 *(string)*:  Returns the string.
5539
5540 #### Example
5541 ```js
5542 _.toString(null);
5543 // => ''
5544
5545 _.toString(-0);
5546 // => '-0'
5547
5548 _.toString([1, 2, 3]);
5549 // => '1,2,3'
5550 ```
5551 * * *
5552
5553 <!-- /div -->
5554
5555 <!-- /div -->
5556
5557 <!-- div -->
5558
5559 ## `“Math” Methods`
5560
5561 <!-- div -->
5562
5563 ### <a id="_addaugend-addend"></a>`_.add(augend, addend)`
5564 <a href="#_addaugend-addend">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L14054 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.add "See the npm package")
5565
5566 Adds two numbers.
5567
5568 #### Arguments
5569 1. `augend` *(number)*: The first number in an addition.
5570 2. `addend` *(number)*: The second number in an addition.
5571
5572 #### Returns
5573 *(number)*:  Returns the total.
5574
5575 #### Example
5576 ```js
5577 _.add(6, 4);
5578 // => 10
5579 ```
5580 * * *
5581
5582 <!-- /div -->
5583
5584 <!-- div -->
5585
5586 ### <a id="_ceilnumber-precision0"></a>`_.ceil(number, [precision=0])`
5587 <a href="#_ceilnumber-precision0">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L14088 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.ceil "See the npm package")
5588
5589 Computes `number` rounded up to `precision`.
5590
5591 #### Arguments
5592 1. `number` *(number)*: The number to round up.
5593 2. `[precision=0]` *(number)*: The precision to round up to.
5594
5595 #### Returns
5596 *(number)*:  Returns the rounded up number.
5597
5598 #### Example
5599 ```js
5600 _.ceil(4.006);
5601 // => 5
5602
5603 _.ceil(6.004, 2);
5604 // => 6.01
5605
5606 _.ceil(6040, -2);
5607 // => 6100
5608 ```
5609 * * *
5610
5611 <!-- /div -->
5612
5613 <!-- div -->
5614
5615 ### <a id="_floornumber-precision0"></a>`_.floor(number, [precision=0])`
5616 <a href="#_floornumber-precision0">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L14110 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.floor "See the npm package")
5617
5618 Computes `number` rounded down to `precision`.
5619
5620 #### Arguments
5621 1. `number` *(number)*: The number to round down.
5622 2. `[precision=0]` *(number)*: The precision to round down to.
5623
5624 #### Returns
5625 *(number)*:  Returns the rounded down number.
5626
5627 #### Example
5628 ```js
5629 _.floor(4.006);
5630 // => 4
5631
5632 _.floor(0.046, 2);
5633 // => 0.04
5634
5635 _.floor(4060, -2);
5636 // => 4000
5637 ```
5638 * * *
5639
5640 <!-- /div -->
5641
5642 <!-- div -->
5643
5644 ### <a id="_maxarray"></a>`_.max(array)`
5645 <a href="#_maxarray">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L14129 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.max "See the npm package")
5646
5647 Computes the maximum value of `array`. If `array` is empty or falsey
5648 `undefined` is returned.
5649
5650 #### Arguments
5651 1. `array` *(Array)*: The array to iterate over.
5652
5653 #### Returns
5654 *(&#42;)*:  Returns the maximum value.
5655
5656 #### Example
5657 ```js
5658 _.max([4, 2, 8, 6]);
5659 // => 8
5660
5661 _.max([]);
5662 // => undefined
5663 ```
5664 * * *
5665
5666 <!-- /div -->
5667
5668 <!-- div -->
5669
5670 ### <a id="_maxbyarray-iteratee_identity"></a>`_.maxBy(array, [iteratee=_.identity])`
5671 <a href="#_maxbyarray-iteratee_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L14157 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.maxby "See the npm package")
5672
5673 This method is like `_.max` except that it accepts `iteratee` which is
5674 invoked for each element in `array` to generate the criterion by which
5675 the value is ranked. The iteratee is invoked with one argument: (value).
5676
5677 #### Arguments
5678 1. `array` *(Array)*: The array to iterate over.
5679 2. `[iteratee=_.identity]` *(Function|Object|string)*: The iteratee invoked per element.
5680
5681 #### Returns
5682 *(&#42;)*:  Returns the maximum value.
5683
5684 #### Example
5685 ```js
5686 var objects = [{ 'n': 1 }, { 'n': 2 }];
5687
5688 _.maxBy(objects, function(o) { return o.n; });
5689 // => { 'n': 2 }
5690
5691 // The `_.property` iteratee shorthand.
5692 _.maxBy(objects, 'n');
5693 // => { 'n': 2 }
5694 ```
5695 * * *
5696
5697 <!-- /div -->
5698
5699 <!-- div -->
5700
5701 ### <a id="_meanarray"></a>`_.mean(array)`
5702 <a href="#_meanarray">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L14176 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.mean "See the npm package")
5703
5704 Computes the mean of the values in `array`.
5705
5706 #### Arguments
5707 1. `array` *(Array)*: The array to iterate over.
5708
5709 #### Returns
5710 *(number)*:  Returns the mean.
5711
5712 #### Example
5713 ```js
5714 _.mean([4, 2, 8, 6]);
5715 // => 5
5716 ```
5717 * * *
5718
5719 <!-- /div -->
5720
5721 <!-- div -->
5722
5723 ### <a id="_minarray"></a>`_.min(array)`
5724 <a href="#_minarray">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L14197 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.min "See the npm package")
5725
5726 Computes the minimum value of `array`. If `array` is empty or falsey
5727 `undefined` is returned.
5728
5729 #### Arguments
5730 1. `array` *(Array)*: The array to iterate over.
5731
5732 #### Returns
5733 *(&#42;)*:  Returns the minimum value.
5734
5735 #### Example
5736 ```js
5737 _.min([4, 2, 8, 6]);
5738 // => 2
5739
5740 _.min([]);
5741 // => undefined
5742 ```
5743 * * *
5744
5745 <!-- /div -->
5746
5747 <!-- div -->
5748
5749 ### <a id="_minbyarray-iteratee_identity"></a>`_.minBy(array, [iteratee=_.identity])`
5750 <a href="#_minbyarray-iteratee_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L14225 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.minby "See the npm package")
5751
5752 This method is like `_.min` except that it accepts `iteratee` which is
5753 invoked for each element in `array` to generate the criterion by which
5754 the value is ranked. The iteratee is invoked with one argument: (value).
5755
5756 #### Arguments
5757 1. `array` *(Array)*: The array to iterate over.
5758 2. `[iteratee=_.identity]` *(Function|Object|string)*: The iteratee invoked per element.
5759
5760 #### Returns
5761 *(&#42;)*:  Returns the minimum value.
5762
5763 #### Example
5764 ```js
5765 var objects = [{ 'n': 1 }, { 'n': 2 }];
5766
5767 _.minBy(objects, function(o) { return o.n; });
5768 // => { 'n': 1 }
5769
5770 // The `_.property` iteratee shorthand.
5771 _.minBy(objects, 'n');
5772 // => { 'n': 1 }
5773 ```
5774 * * *
5775
5776 <!-- /div -->
5777
5778 <!-- div -->
5779
5780 ### <a id="_roundnumber-precision0"></a>`_.round(number, [precision=0])`
5781 <a href="#_roundnumber-precision0">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L14251 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.round "See the npm package")
5782
5783 Computes `number` rounded to `precision`.
5784
5785 #### Arguments
5786 1. `number` *(number)*: The number to round.
5787 2. `[precision=0]` *(number)*: The precision to round to.
5788
5789 #### Returns
5790 *(number)*:  Returns the rounded number.
5791
5792 #### Example
5793 ```js
5794 _.round(4.006);
5795 // => 4
5796
5797 _.round(4.006, 2);
5798 // => 4.01
5799
5800 _.round(4060, -2);
5801 // => 4100
5802 ```
5803 * * *
5804
5805 <!-- /div -->
5806
5807 <!-- div -->
5808
5809 ### <a id="_subtractminuend-subtrahend"></a>`_.subtract(minuend, subtrahend)`
5810 <a href="#_subtractminuend-subtrahend">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L14267 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.subtract "See the npm package")
5811
5812 Subtract two numbers.
5813
5814 #### Arguments
5815 1. `minuend` *(number)*: The first number in a subtraction.
5816 2. `subtrahend` *(number)*: The second number in a subtraction.
5817
5818 #### Returns
5819 *(number)*:  Returns the difference.
5820
5821 #### Example
5822 ```js
5823 _.subtract(6, 4);
5824 // => 2
5825 ```
5826 * * *
5827
5828 <!-- /div -->
5829
5830 <!-- div -->
5831
5832 ### <a id="_sumarray"></a>`_.sum(array)`
5833 <a href="#_sumarray">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L14294 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.sum "See the npm package")
5834
5835 Computes the sum of the values in `array`.
5836
5837 #### Arguments
5838 1. `array` *(Array)*: The array to iterate over.
5839
5840 #### Returns
5841 *(number)*:  Returns the sum.
5842
5843 #### Example
5844 ```js
5845 _.sum([4, 2, 8, 6]);
5846 // => 20
5847 ```
5848 * * *
5849
5850 <!-- /div -->
5851
5852 <!-- div -->
5853
5854 ### <a id="_sumbyarray-iteratee_identity"></a>`_.sumBy(array, [iteratee=_.identity])`
5855 <a href="#_sumbyarray-iteratee_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L14322 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.sumby "See the npm package")
5856
5857 This method is like `_.sum` except that it accepts `iteratee` which is
5858 invoked for each element in `array` to generate the value to be summed.
5859 The iteratee is invoked with one argument: (value).
5860
5861 #### Arguments
5862 1. `array` *(Array)*: The array to iterate over.
5863 2. `[iteratee=_.identity]` *(Function|Object|string)*: The iteratee invoked per element.
5864
5865 #### Returns
5866 *(number)*:  Returns the sum.
5867
5868 #### Example
5869 ```js
5870 var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
5871
5872 _.sumBy(objects, function(o) { return o.n; });
5873 // => 20
5874
5875 // The `_.property` iteratee shorthand.
5876 _.sumBy(objects, 'n');
5877 // => 20
5878 ```
5879 * * *
5880
5881 <!-- /div -->
5882
5883 <!-- /div -->
5884
5885 <!-- div -->
5886
5887 ## `“Number” Methods`
5888
5889 <!-- div -->
5890
5891 ### <a id="_clampnumber-lower-upper"></a>`_.clamp(number, [lower], upper)`
5892 <a href="#_clampnumber-lower-upper">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L12074 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.clamp "See the npm package")
5893
5894 Clamps `number` within the inclusive `lower` and `upper` bounds.
5895
5896 #### Arguments
5897 1. `number` *(number)*: The number to clamp.
5898 2. `[lower]` *(number)*: The lower bound.
5899 3. `upper` *(number)*: The upper bound.
5900
5901 #### Returns
5902 *(number)*:  Returns the clamped number.
5903
5904 #### Example
5905 ```js
5906 _.clamp(-10, -5, 5);
5907 // => -5
5908
5909 _.clamp(10, -5, 5);
5910 // => 5
5911 ```
5912 * * *
5913
5914 <!-- /div -->
5915
5916 <!-- div -->
5917
5918 ### <a id="_inrangenumber-start0-end"></a>`_.inRange(number, [start=0], end)`
5919 <a href="#_inrangenumber-start0-end">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L12126 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.inrange "See the npm package")
5920
5921 Checks if `n` is between `start` and up to but not including, `end`. If
5922 `end` is not specified it's set to `start` with `start` then set to `0`.
5923 If `start` is greater than `end` the params are swapped to support
5924 negative ranges.
5925
5926 #### Arguments
5927 1. `number` *(number)*: The number to check.
5928 2. `[start=0]` *(number)*: The start of the range.
5929 3. `end` *(number)*: The end of the range.
5930
5931 #### Returns
5932 *(boolean)*:  Returns `true` if `number` is in the range, else `false`.
5933
5934 #### Example
5935 ```js
5936 _.inRange(3, 2, 4);
5937 // => true
5938
5939 _.inRange(4, 8);
5940 // => true
5941
5942 _.inRange(4, 2);
5943 // => false
5944
5945 _.inRange(2, 2);
5946 // => false
5947
5948 _.inRange(1.2, 2);
5949 // => true
5950
5951 _.inRange(5.2, 4);
5952 // => false
5953
5954 _.inRange(-3, -2, -6);
5955 // => true
5956 ```
5957 * * *
5958
5959 <!-- /div -->
5960
5961 <!-- div -->
5962
5963 ### <a id="_randomlower0-upper1-floating"></a>`_.random([lower=0], [upper=1], [floating])`
5964 <a href="#_randomlower0-upper1-floating">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L12168 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.random "See the npm package")
5965
5966 Produces a random number between the inclusive `lower` and `upper` bounds.
5967 If only one argument is provided a number between `0` and the given number
5968 is returned. If `floating` is `true`, or either `lower` or `upper` are floats,
5969 a floating-point number is returned instead of an integer.
5970 <br>
5971 <br>
5972 **Note:** JavaScript follows the IEEE-754 standard for resolving
5973 floating-point values which can produce unexpected results.
5974
5975 #### Arguments
5976 1. `[lower=0]` *(number)*: The lower bound.
5977 2. `[upper=1]` *(number)*: The upper bound.
5978 3. `[floating]` *(boolean)*: Specify returning a floating-point number.
5979
5980 #### Returns
5981 *(number)*:  Returns the random number.
5982
5983 #### Example
5984 ```js
5985 _.random(0, 5);
5986 // => an integer between 0 and 5
5987
5988 _.random(5);
5989 // => also an integer between 0 and 5
5990
5991 _.random(5, true);
5992 // => a floating-point number between 0 and 5
5993
5994 _.random(1.2, 5.2);
5995 // => a floating-point number between 1.2 and 5.2
5996 ```
5997 * * *
5998
5999 <!-- /div -->
6000
6001 <!-- /div -->
6002
6003 <!-- div -->
6004
6005 ## `“Object” Methods`
6006
6007 <!-- div -->
6008
6009 ### <a id="_assignobject-sources"></a>`_.assign(object, [sources])`
6010 <a href="#_assignobject-sources">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L10838 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.assign "See the npm package")
6011
6012 Assigns own enumerable properties of source objects to the destination
6013 object. Source objects are applied from left to right. Subsequent sources
6014 overwrite property assignments of previous sources.
6015 <br>
6016 <br>
6017 **Note:** This method mutates `object` and is loosely based on
6018 [`Object.assign`](https://mdn.io/Object/assign).
6019
6020 #### Arguments
6021 1. `object` *(Object)*: The destination object.
6022 2. `[sources]` *(...Object)*: The source objects.
6023
6024 #### Returns
6025 *(Object)*:  Returns `object`.
6026
6027 #### Example
6028 ```js
6029 function Foo() {
6030   this.c = 3;
6031 }
6032
6033 function Bar() {
6034   this.e = 5;
6035 }
6036
6037 Foo.prototype.d = 4;
6038 Bar.prototype.f = 6;
6039
6040 _.assign({ 'a': 1 }, new Foo, new Bar);
6041 // => { 'a': 1, 'c': 3, 'e': 5 }
6042 ```
6043 * * *
6044
6045 <!-- /div -->
6046
6047 <!-- div -->
6048
6049 ### <a id="_assigninobject-sources"></a>`_.assignIn(object, [sources])`
6050 <a href="#_assigninobject-sources">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L10871 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.assignin "See the npm package")
6051
6052 This method is like `_.assign` except that it iterates over own and
6053 inherited source properties.
6054 <br>
6055 <br>
6056 **Note:** This method mutates `object`.
6057
6058 #### Aliases
6059 *_.extend*
6060
6061 #### Arguments
6062 1. `object` *(Object)*: The destination object.
6063 2. `[sources]` *(...Object)*: The source objects.
6064
6065 #### Returns
6066 *(Object)*:  Returns `object`.
6067
6068 #### Example
6069 ```js
6070 function Foo() {
6071   this.b = 2;
6072 }
6073
6074 function Bar() {
6075   this.d = 4;
6076 }
6077
6078 Foo.prototype.c = 3;
6079 Bar.prototype.e = 5;
6080
6081 _.assignIn({ 'a': 1 }, new Foo, new Bar);
6082 // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5 }
6083 ```
6084 * * *
6085
6086 <!-- /div -->
6087
6088 <!-- div -->
6089
6090 ### <a id="_assigninwithobject-sources-customizer"></a>`_.assignInWith(object, sources, [customizer])`
6091 <a href="#_assigninwithobject-sources-customizer">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L10902 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.assigninwith "See the npm package")
6092
6093 This method is like `_.assignIn` except that it accepts `customizer` which
6094 is invoked to produce the assigned values. If `customizer` returns `undefined`
6095 assignment is handled by the method instead. The `customizer` is invoked
6096 with five arguments: (objValue, srcValue, key, object, source).
6097 <br>
6098 <br>
6099 **Note:** This method mutates `object`.
6100
6101 #### Aliases
6102 *_.extendWith*
6103
6104 #### Arguments
6105 1. `object` *(Object)*: The destination object.
6106 2. `sources` *(...Object)*: The source objects.
6107 3. `[customizer]` *(Function)*: The function to customize assigned values.
6108
6109 #### Returns
6110 *(Object)*:  Returns `object`.
6111
6112 #### Example
6113 ```js
6114 function customizer(objValue, srcValue) {
6115   return _.isUndefined(objValue) ? srcValue : objValue;
6116 }
6117
6118 var defaults = _.partialRight(_.assignInWith, customizer);
6119
6120 defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
6121 // => { 'a': 1, 'b': 2 }
6122 ```
6123 * * *
6124
6125 <!-- /div -->
6126
6127 <!-- div -->
6128
6129 ### <a id="_assignwithobject-sources-customizer"></a>`_.assignWith(object, sources, [customizer])`
6130 <a href="#_assignwithobject-sources-customizer">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L10932 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.assignwith "See the npm package")
6131
6132 This method is like `_.assign` except that it accepts `customizer` which
6133 is invoked to produce the assigned values. If `customizer` returns `undefined`
6134 assignment is handled by the method instead. The `customizer` is invoked
6135 with five arguments: (objValue, srcValue, key, object, source).
6136 <br>
6137 <br>
6138 **Note:** This method mutates `object`.
6139
6140 #### Arguments
6141 1. `object` *(Object)*: The destination object.
6142 2. `sources` *(...Object)*: The source objects.
6143 3. `[customizer]` *(Function)*: The function to customize assigned values.
6144
6145 #### Returns
6146 *(Object)*:  Returns `object`.
6147
6148 #### Example
6149 ```js
6150 function customizer(objValue, srcValue) {
6151   return _.isUndefined(objValue) ? srcValue : objValue;
6152 }
6153
6154 var defaults = _.partialRight(_.assignWith, customizer);
6155
6156 defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
6157 // => { 'a': 1, 'b': 2 }
6158 ```
6159 * * *
6160
6161 <!-- /div -->
6162
6163 <!-- div -->
6164
6165 ### <a id="_atobject-paths"></a>`_.at(object, [paths])`
6166 <a href="#_atobject-paths">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L10956 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.at "See the npm package")
6167
6168 Creates an array of values corresponding to `paths` of `object`.
6169
6170 #### Arguments
6171 1. `object` *(Object)*: The object to iterate over.
6172 2. `[paths]` *(...(string|string&#91;&#93;)*: The property paths of elements to pick, specified individually or in arrays.
6173
6174 #### Returns
6175 *(Array)*:  Returns the new array of picked elements.
6176
6177 #### Example
6178 ```js
6179 var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
6180
6181 _.at(object, ['a[0].b.c', 'a[1]']);
6182 // => [3, 4]
6183
6184 _.at(['a', 'b', 'c'], 0, 2);
6185 // => ['a', 'c']
6186 ```
6187 * * *
6188
6189 <!-- /div -->
6190
6191 <!-- div -->
6192
6193 ### <a id="_createprototype-properties"></a>`_.create(prototype, [properties])`
6194 <a href="#_createprototype-properties">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L10992 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.create "See the npm package")
6195
6196 Creates an object that inherits from the `prototype` object. If a `properties`
6197 object is given its own enumerable properties are assigned to the created object.
6198
6199 #### Arguments
6200 1. `prototype` *(Object)*: The object to inherit from.
6201 2. `[properties]` *(Object)*: The properties to assign to the object.
6202
6203 #### Returns
6204 *(Object)*:  Returns the new object.
6205
6206 #### Example
6207 ```js
6208 function Shape() {
6209   this.x = 0;
6210   this.y = 0;
6211 }
6212
6213 function Circle() {
6214   Shape.call(this);
6215 }
6216
6217 Circle.prototype = _.create(Shape.prototype, {
6218   'constructor': Circle
6219 });
6220
6221 var circle = new Circle;
6222 circle instanceof Circle;
6223 // => true
6224
6225 circle instanceof Shape;
6226 // => true
6227 ```
6228 * * *
6229
6230 <!-- /div -->
6231
6232 <!-- div -->
6233
6234 ### <a id="_defaultsobject-sources"></a>`_.defaults(object, [sources])`
6235 <a href="#_defaultsobject-sources">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L11016 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.defaults "See the npm package")
6236
6237 Assigns own and inherited enumerable properties of source objects to the
6238 destination object for all destination properties that resolve to `undefined`.
6239 Source objects are applied from left to right. Once a property is set,
6240 additional values of the same property are ignored.
6241 <br>
6242 <br>
6243 **Note:** This method mutates `object`.
6244
6245 #### Arguments
6246 1. `object` *(Object)*: The destination object.
6247 2. `[sources]` *(...Object)*: The source objects.
6248
6249 #### Returns
6250 *(Object)*:  Returns `object`.
6251
6252 #### Example
6253 ```js
6254 _.defaults({ 'user': 'barney' }, { 'age': 36 }, { 'user': 'fred' });
6255 // => { 'user': 'barney', 'age': 36 }
6256 ```
6257 * * *
6258
6259 <!-- /div -->
6260
6261 <!-- div -->
6262
6263 ### <a id="_defaultsdeepobject-sources"></a>`_.defaultsDeep(object, [sources])`
6264 <a href="#_defaultsdeepobject-sources">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L11039 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.defaultsdeep "See the npm package")
6265
6266 This method is like `_.defaults` except that it recursively assigns
6267 default properties.
6268 <br>
6269 <br>
6270 **Note:** This method mutates `object`.
6271
6272 #### Arguments
6273 1. `object` *(Object)*: The destination object.
6274 2. `[sources]` *(...Object)*: The source objects.
6275
6276 #### Returns
6277 *(Object)*:  Returns `object`.
6278
6279 #### Example
6280 ```js
6281 _.defaultsDeep({ 'user': { 'name': 'barney' } }, { 'user': { 'name': 'fred', 'age': 36 } });
6282 // => { 'user': { 'name': 'barney', 'age': 36 } }
6283 ```
6284 * * *
6285
6286 <!-- /div -->
6287
6288 <!-- div -->
6289
6290 ### <a id="_findkeyobject-predicate_identity"></a>`_.findKey(object, [predicate=_.identity])`
6291 <a href="#_findkeyobject-predicate_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L11077 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.findkey "See the npm package")
6292
6293 This method is like `_.find` except that it returns the key of the first
6294 element `predicate` returns truthy for instead of the element itself.
6295
6296 #### Arguments
6297 1. `object` *(Object)*: The object to search.
6298 2. `[predicate=_.identity]` *(Function|Object|string)*: The function invoked per iteration.
6299
6300 #### Returns
6301 *(string|undefined)*:  Returns the key of the matched element, else `undefined`.
6302
6303 #### Example
6304 ```js
6305 var users = {
6306   'barney':  { 'age': 36, 'active': true },
6307   'fred':    { 'age': 40, 'active': false },
6308   'pebbles': { 'age': 1,  'active': true }
6309 };
6310
6311 _.findKey(users, function(o) { return o.age < 40; });
6312 // => 'barney' (iteration order is not guaranteed)
6313
6314 // The `_.matches` iteratee shorthand.
6315 _.findKey(users, { 'age': 1, 'active': true });
6316 // => 'pebbles'
6317
6318 // The `_.matchesProperty` iteratee shorthand.
6319 _.findKey(users, ['active', false]);
6320 // => 'fred'
6321
6322 // The `_.property` iteratee shorthand.
6323 _.findKey(users, 'active');
6324 // => 'barney'
6325 ```
6326 * * *
6327
6328 <!-- /div -->
6329
6330 <!-- div -->
6331
6332 ### <a id="_findlastkeyobject-predicate_identity"></a>`_.findLastKey(object, [predicate=_.identity])`
6333 <a href="#_findlastkeyobject-predicate_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L11114 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.findlastkey "See the npm package")
6334
6335 This method is like `_.findKey` except that it iterates over elements of
6336 a collection in the opposite order.
6337
6338 #### Arguments
6339 1. `object` *(Object)*: The object to search.
6340 2. `[predicate=_.identity]` *(Function|Object|string)*: The function invoked per iteration.
6341
6342 #### Returns
6343 *(string|undefined)*:  Returns the key of the matched element, else `undefined`.
6344
6345 #### Example
6346 ```js
6347 var users = {
6348   'barney':  { 'age': 36, 'active': true },
6349   'fred':    { 'age': 40, 'active': false },
6350   'pebbles': { 'age': 1,  'active': true }
6351 };
6352
6353 _.findLastKey(users, function(o) { return o.age < 40; });
6354 // => returns 'pebbles' assuming `_.findKey` returns 'barney'
6355
6356 // The `_.matches` iteratee shorthand.
6357 _.findLastKey(users, { 'age': 36, 'active': true });
6358 // => 'barney'
6359
6360 // The `_.matchesProperty` iteratee shorthand.
6361 _.findLastKey(users, ['active', false]);
6362 // => 'fred'
6363
6364 // The `_.property` iteratee shorthand.
6365 _.findLastKey(users, 'active');
6366 // => 'pebbles'
6367 ```
6368 * * *
6369
6370 <!-- /div -->
6371
6372 <!-- div -->
6373
6374 ### <a id="_forinobject-iteratee_identity"></a>`_.forIn(object, [iteratee=_.identity])`
6375 <a href="#_forinobject-iteratee_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L11144 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.forin "See the npm package")
6376
6377 Iterates over own and inherited enumerable properties of an object invoking
6378 `iteratee` for each property. The iteratee is invoked with three arguments:<br>
6379 (value, key, object). Iteratee functions may exit iteration early by explicitly
6380 returning `false`.
6381
6382 #### Arguments
6383 1. `object` *(Object)*: The object to iterate over.
6384 2. `[iteratee=_.identity]` *(Function)*: The function invoked per iteration.
6385
6386 #### Returns
6387 *(Object)*:  Returns `object`.
6388
6389 #### Example
6390 ```js
6391 function Foo() {
6392   this.a = 1;
6393   this.b = 2;
6394 }
6395
6396 Foo.prototype.c = 3;
6397
6398 _.forIn(new Foo, function(value, key) {
6399   console.log(key);
6400 });
6401 // => logs 'a', 'b', then 'c' (iteration order is not guaranteed)
6402 ```
6403 * * *
6404
6405 <!-- /div -->
6406
6407 <!-- div -->
6408
6409 ### <a id="_forinrightobject-iteratee_identity"></a>`_.forInRight(object, [iteratee=_.identity])`
6410 <a href="#_forinrightobject-iteratee_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L11174 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.forinright "See the npm package")
6411
6412 This method is like `_.forIn` except that it iterates over properties of
6413 `object` in the opposite order.
6414
6415 #### Arguments
6416 1. `object` *(Object)*: The object to iterate over.
6417 2. `[iteratee=_.identity]` *(Function)*: The function invoked per iteration.
6418
6419 #### Returns
6420 *(Object)*:  Returns `object`.
6421
6422 #### Example
6423 ```js
6424 function Foo() {
6425   this.a = 1;
6426   this.b = 2;
6427 }
6428
6429 Foo.prototype.c = 3;
6430
6431 _.forInRight(new Foo, function(value, key) {
6432   console.log(key);
6433 });
6434 // => logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'
6435 ```
6436 * * *
6437
6438 <!-- /div -->
6439
6440 <!-- div -->
6441
6442 ### <a id="_forownobject-iteratee_identity"></a>`_.forOwn(object, [iteratee=_.identity])`
6443 <a href="#_forownobject-iteratee_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L11206 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.forown "See the npm package")
6444
6445 Iterates over own enumerable properties of an object invoking `iteratee`
6446 for each property. The iteratee is invoked with three arguments:<br>
6447 (value, key, object). Iteratee functions may exit iteration early by
6448 explicitly returning `false`.
6449
6450 #### Arguments
6451 1. `object` *(Object)*: The object to iterate over.
6452 2. `[iteratee=_.identity]` *(Function)*: The function invoked per iteration.
6453
6454 #### Returns
6455 *(Object)*:  Returns `object`.
6456
6457 #### Example
6458 ```js
6459 function Foo() {
6460   this.a = 1;
6461   this.b = 2;
6462 }
6463
6464 Foo.prototype.c = 3;
6465
6466 _.forOwn(new Foo, function(value, key) {
6467   console.log(key);
6468 });
6469 // => logs 'a' then 'b' (iteration order is not guaranteed)
6470 ```
6471 * * *
6472
6473 <!-- /div -->
6474
6475 <!-- div -->
6476
6477 ### <a id="_forownrightobject-iteratee_identity"></a>`_.forOwnRight(object, [iteratee=_.identity])`
6478 <a href="#_forownrightobject-iteratee_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L11234 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.forownright "See the npm package")
6479
6480 This method is like `_.forOwn` except that it iterates over properties of
6481 `object` in the opposite order.
6482
6483 #### Arguments
6484 1. `object` *(Object)*: The object to iterate over.
6485 2. `[iteratee=_.identity]` *(Function)*: The function invoked per iteration.
6486
6487 #### Returns
6488 *(Object)*:  Returns `object`.
6489
6490 #### Example
6491 ```js
6492 function Foo() {
6493   this.a = 1;
6494   this.b = 2;
6495 }
6496
6497 Foo.prototype.c = 3;
6498
6499 _.forOwnRight(new Foo, function(value, key) {
6500   console.log(key);
6501 });
6502 // => logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'
6503 ```
6504 * * *
6505
6506 <!-- /div -->
6507
6508 <!-- div -->
6509
6510 ### <a id="_functionsobject"></a>`_.functions(object)`
6511 <a href="#_functionsobject">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L11259 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.functions "See the npm package")
6512
6513 Creates an array of function property names from own enumerable properties
6514 of `object`.
6515
6516 #### Arguments
6517 1. `object` *(Object)*: The object to inspect.
6518
6519 #### Returns
6520 *(Array)*:  Returns the new array of property names.
6521
6522 #### Example
6523 ```js
6524 function Foo() {
6525   this.a = _.constant('a');
6526   this.b = _.constant('b');
6527 }
6528
6529 Foo.prototype.c = _.constant('c');
6530
6531 _.functions(new Foo);
6532 // => ['a', 'b']
6533 ```
6534 * * *
6535
6536 <!-- /div -->
6537
6538 <!-- div -->
6539
6540 ### <a id="_functionsinobject"></a>`_.functionsIn(object)`
6541 <a href="#_functionsinobject">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L11284 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.functionsin "See the npm package")
6542
6543 Creates an array of function property names from own and inherited
6544 enumerable properties of `object`.
6545
6546 #### Arguments
6547 1. `object` *(Object)*: The object to inspect.
6548
6549 #### Returns
6550 *(Array)*:  Returns the new array of property names.
6551
6552 #### Example
6553 ```js
6554 function Foo() {
6555   this.a = _.constant('a');
6556   this.b = _.constant('b');
6557 }
6558
6559 Foo.prototype.c = _.constant('c');
6560
6561 _.functionsIn(new Foo);
6562 // => ['a', 'b', 'c']
6563 ```
6564 * * *
6565
6566 <!-- /div -->
6567
6568 <!-- div -->
6569
6570 ### <a id="_getobject-path-defaultvalue"></a>`_.get(object, path, [defaultValue])`
6571 <a href="#_getobject-path-defaultvalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L11312 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.get "See the npm package")
6572
6573 Gets the value at `path` of `object`. If the resolved value is
6574 `undefined` the `defaultValue` is used in its place.
6575
6576 #### Arguments
6577 1. `object` *(Object)*: The object to query.
6578 2. `path` *(Array|string)*: The path of the property to get.
6579 3. `[defaultValue]` *(&#42;)*: The value returned if the resolved value is `undefined`.
6580
6581 #### Returns
6582 *(&#42;)*:  Returns the resolved value.
6583
6584 #### Example
6585 ```js
6586 var object = { 'a': [{ 'b': { 'c': 3 } }] };
6587
6588 _.get(object, 'a[0].b.c');
6589 // => 3
6590
6591 _.get(object, ['a', '0', 'b', 'c']);
6592 // => 3
6593
6594 _.get(object, 'a.b.c', 'default');
6595 // => 'default'
6596 ```
6597 * * *
6598
6599 <!-- /div -->
6600
6601 <!-- div -->
6602
6603 ### <a id="_hasobject-path"></a>`_.has(object, path)`
6604 <a href="#_hasobject-path">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L11343 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.has "See the npm package")
6605
6606 Checks if `path` is a direct property of `object`.
6607
6608 #### Arguments
6609 1. `object` *(Object)*: The object to query.
6610 2. `path` *(Array|string)*: The path to check.
6611
6612 #### Returns
6613 *(boolean)*:  Returns `true` if `path` exists, else `false`.
6614
6615 #### Example
6616 ```js
6617 var object = { 'a': { 'b': { 'c': 3 } } };
6618 var other = _.create({ 'a': _.create({ 'b': _.create({ 'c': 3 }) }) });
6619
6620 _.has(object, 'a');
6621 // => true
6622
6623 _.has(object, 'a.b.c');
6624 // => true
6625
6626 _.has(object, ['a', 'b', 'c']);
6627 // => true
6628
6629 _.has(other, 'a');
6630 // => false
6631 ```
6632 * * *
6633
6634 <!-- /div -->
6635
6636 <!-- div -->
6637
6638 ### <a id="_hasinobject-path"></a>`_.hasIn(object, path)`
6639 <a href="#_hasinobject-path">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L11372 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.hasin "See the npm package")
6640
6641 Checks if `path` is a direct or inherited property of `object`.
6642
6643 #### Arguments
6644 1. `object` *(Object)*: The object to query.
6645 2. `path` *(Array|string)*: The path to check.
6646
6647 #### Returns
6648 *(boolean)*:  Returns `true` if `path` exists, else `false`.
6649
6650 #### Example
6651 ```js
6652 var object = _.create({ 'a': _.create({ 'b': _.create({ 'c': 3 }) }) });
6653
6654 _.hasIn(object, 'a');
6655 // => true
6656
6657 _.hasIn(object, 'a.b.c');
6658 // => true
6659
6660 _.hasIn(object, ['a', 'b', 'c']);
6661 // => true
6662
6663 _.hasIn(object, 'b');
6664 // => false
6665 ```
6666 * * *
6667
6668 <!-- /div -->
6669
6670 <!-- div -->
6671
6672 ### <a id="_invertobject"></a>`_.invert(object)`
6673 <a href="#_invertobject">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L11393 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.invert "See the npm package")
6674
6675 Creates an object composed of the inverted keys and values of `object`.
6676 If `object` contains duplicate values, subsequent values overwrite property
6677 assignments of previous values.
6678
6679 #### Arguments
6680 1. `object` *(Object)*: The object to invert.
6681
6682 #### Returns
6683 *(Object)*:  Returns the new inverted object.
6684
6685 #### Example
6686 ```js
6687 var object = { 'a': 1, 'b': 2, 'c': 1 };
6688
6689 _.invert(object);
6690 // => { '1': 'c', '2': 'b' }
6691 ```
6692 * * *
6693
6694 <!-- /div -->
6695
6696 <!-- div -->
6697
6698 ### <a id="_invertbyobject-iteratee_identity"></a>`_.invertBy(object, [iteratee=_.identity])`
6699 <a href="#_invertbyobject-iteratee_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L11422 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.invertby "See the npm package")
6700
6701 This method is like `_.invert` except that the inverted object is generated
6702 from the results of running each element of `object` through `iteratee`.
6703 The corresponding inverted value of each inverted key is an array of keys
6704 responsible for generating the inverted value. The iteratee is invoked
6705 with one argument: (value).
6706
6707 #### Arguments
6708 1. `object` *(Object)*: The object to invert.
6709 2. `[iteratee=_.identity]` *(Function|Object|string)*: The iteratee invoked per element.
6710
6711 #### Returns
6712 *(Object)*:  Returns the new inverted object.
6713
6714 #### Example
6715 ```js
6716 var object = { 'a': 1, 'b': 2, 'c': 1 };
6717
6718 _.invertBy(object);
6719 // => { '1': ['a', 'c'], '2': ['b'] }
6720
6721 _.invertBy(object, function(value) {
6722   return 'group' + value;
6723 });
6724 // => { 'group1': ['a', 'c'], 'group2': ['b'] }
6725 ```
6726 * * *
6727
6728 <!-- /div -->
6729
6730 <!-- div -->
6731
6732 ### <a id="_invokeobject-path-args"></a>`_.invoke(object, path, [args])`
6733 <a href="#_invokeobject-path-args">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L11447 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.invoke "See the npm package")
6734
6735 Invokes the method at `path` of `object`.
6736
6737 #### Arguments
6738 1. `object` *(Object)*: The object to query.
6739 2. `path` *(Array|string)*: The path of the method to invoke.
6740 3. `[args]` *(...&#42;)*: The arguments to invoke the method with.
6741
6742 #### Returns
6743 *(&#42;)*:  Returns the result of the invoked method.
6744
6745 #### Example
6746 ```js
6747 var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] };
6748
6749 _.invoke(object, 'a[0].b.c.slice', 1, 3);
6750 // => [2, 3]
6751 ```
6752 * * *
6753
6754 <!-- /div -->
6755
6756 <!-- div -->
6757
6758 ### <a id="_keysobject"></a>`_.keys(object)`
6759 <a href="#_keysobject">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L11476 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.keys "See the npm package")
6760
6761 Creates an array of the own enumerable property names of `object`.
6762 <br>
6763 <br>
6764 **Note:** Non-object values are coerced to objects. See the
6765 [ES spec](http://ecma-international.org/ecma-262/6.0/#sec-object.keys)
6766 for more details.
6767
6768 #### Arguments
6769 1. `object` *(Object)*: The object to query.
6770
6771 #### Returns
6772 *(Array)*:  Returns the array of property names.
6773
6774 #### Example
6775 ```js
6776 function Foo() {
6777   this.a = 1;
6778   this.b = 2;
6779 }
6780
6781 Foo.prototype.c = 3;
6782
6783 _.keys(new Foo);
6784 // => ['a', 'b'] (iteration order is not guaranteed)
6785
6786 _.keys('hi');
6787 // => ['0', '1']
6788 ```
6789 * * *
6790
6791 <!-- /div -->
6792
6793 <!-- div -->
6794
6795 ### <a id="_keysinobject"></a>`_.keysIn(object)`
6796 <a href="#_keysinobject">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L11518 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.keysin "See the npm package")
6797
6798 Creates an array of the own and inherited enumerable property names of `object`.
6799 <br>
6800 <br>
6801 **Note:** Non-object values are coerced to objects.
6802
6803 #### Arguments
6804 1. `object` *(Object)*: The object to query.
6805
6806 #### Returns
6807 *(Array)*:  Returns the array of property names.
6808
6809 #### Example
6810 ```js
6811 function Foo() {
6812   this.a = 1;
6813   this.b = 2;
6814 }
6815
6816 Foo.prototype.c = 3;
6817
6818 _.keysIn(new Foo);
6819 // => ['a', 'b', 'c'] (iteration order is not guaranteed)
6820 ```
6821 * * *
6822
6823 <!-- /div -->
6824
6825 <!-- div -->
6826
6827 ### <a id="_mapkeysobject-iteratee_identity"></a>`_.mapKeys(object, [iteratee=_.identity])`
6828 <a href="#_mapkeysobject-iteratee_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L11557 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.mapkeys "See the npm package")
6829
6830 The opposite of `_.mapValues`; this method creates an object with the
6831 same values as `object` and keys generated by running each own enumerable
6832 property of `object` through `iteratee`. The iteratee is invoked with
6833 three arguments: (value, key, object).
6834
6835 #### Arguments
6836 1. `object` *(Object)*: The object to iterate over.
6837 2. `[iteratee=_.identity]` *(Function|Object|string)*: The function invoked per iteration.
6838
6839 #### Returns
6840 *(Object)*:  Returns the new mapped object.
6841
6842 #### Example
6843 ```js
6844 _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {
6845   return key + value;
6846 });
6847 // => { 'a1': 1, 'b2': 2 }
6848 ```
6849 * * *
6850
6851 <!-- /div -->
6852
6853 <!-- div -->
6854
6855 ### <a id="_mapvaluesobject-iteratee_identity"></a>`_.mapValues(object, [iteratee=_.identity])`
6856 <a href="#_mapvaluesobject-iteratee_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L11592 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.mapvalues "See the npm package")
6857
6858 Creates an object with the same keys as `object` and values generated by
6859 running each own enumerable property of `object` through `iteratee`. The
6860 iteratee is invoked with three arguments: (value, key, object).
6861
6862 #### Arguments
6863 1. `object` *(Object)*: The object to iterate over.
6864 2. `[iteratee=_.identity]` *(Function|Object|string)*: The function invoked per iteration.
6865
6866 #### Returns
6867 *(Object)*:  Returns the new mapped object.
6868
6869 #### Example
6870 ```js
6871 var users = {
6872   'fred':    { 'user': 'fred',    'age': 40 },
6873   'pebbles': { 'user': 'pebbles', 'age': 1 }
6874 };
6875
6876 _.mapValues(users, function(o) { return o.age; });
6877 // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
6878
6879 // The `_.property` iteratee shorthand.
6880 _.mapValues(users, 'age');
6881 // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
6882 ```
6883 * * *
6884
6885 <!-- /div -->
6886
6887 <!-- div -->
6888
6889 ### <a id="_mergeobject-sources"></a>`_.merge(object, [sources])`
6890 <a href="#_mergeobject-sources">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L11631 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.merge "See the npm package")
6891
6892 Recursively merges own and inherited enumerable properties of source objects
6893 into the destination object. Source properties that resolve to `undefined`
6894 are skipped if a destination value exists. Array and plain object properties
6895 are merged recursively. Other objects and value types are overridden by
6896 assignment. Source objects are applied from left to right. Subsequent
6897 sources overwrite property assignments of previous sources.
6898 <br>
6899 <br>
6900 **Note:** This method mutates `object`.
6901
6902 #### Arguments
6903 1. `object` *(Object)*: The destination object.
6904 2. `[sources]` *(...Object)*: The source objects.
6905
6906 #### Returns
6907 *(Object)*:  Returns `object`.
6908
6909 #### Example
6910 ```js
6911 var users = {
6912   'data': [{ 'user': 'barney' }, { 'user': 'fred' }]
6913 };
6914
6915 var ages = {
6916   'data': [{ 'age': 36 }, { 'age': 40 }]
6917 };
6918
6919 _.merge(users, ages);
6920 // => { 'data': [{ 'user': 'barney', 'age': 36 }, { 'user': 'fred', 'age': 40 }] }
6921 ```
6922 * * *
6923
6924 <!-- /div -->
6925
6926 <!-- div -->
6927
6928 ### <a id="_mergewithobject-sources-customizer"></a>`_.mergeWith(object, sources, customizer)`
6929 <a href="#_mergewithobject-sources-customizer">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L11672 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.mergewith "See the npm package")
6930
6931 This method is like `_.merge` except that it accepts `customizer` which
6932 is invoked to produce the merged values of the destination and source
6933 properties. If `customizer` returns `undefined` merging is handled by the
6934 method instead. The `customizer` is invoked with seven arguments:<br>
6935 (objValue, srcValue, key, object, source, stack).
6936 <br>
6937 <br>
6938 **Note:** This method mutates `object`.
6939
6940 #### Arguments
6941 1. `object` *(Object)*: The destination object.
6942 2. `sources` *(...Object)*: The source objects.
6943 3. `customizer` *(Function)*: The function to customize assigned values.
6944
6945 #### Returns
6946 *(Object)*:  Returns `object`.
6947
6948 #### Example
6949 ```js
6950 function customizer(objValue, srcValue) {
6951   if (_.isArray(objValue)) {
6952     return objValue.concat(srcValue);
6953   }
6954 }
6955
6956 var object = {
6957   'fruits': ['apple'],
6958   'vegetables': ['beet']
6959 };
6960
6961 var other = {
6962   'fruits': ['banana'],
6963   'vegetables': ['carrot']
6964 };
6965
6966 _.mergeWith(object, other, customizer);
6967 // => { 'fruits': ['apple', 'banana'], 'vegetables': ['beet', 'carrot'] }
6968 ```
6969 * * *
6970
6971 <!-- /div -->
6972
6973 <!-- div -->
6974
6975 ### <a id="_omitobject-props"></a>`_.omit(object, [props])`
6976 <a href="#_omitobject-props">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L11694 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.omit "See the npm package")
6977
6978 The opposite of `_.pick`; this method creates an object composed of the
6979 own and inherited enumerable properties of `object` that are not omitted.
6980
6981 #### Arguments
6982 1. `object` *(Object)*: The source object.
6983 2. `[props]` *(...(string|string&#91;&#93;)*: The property names to omit, specified individually or in arrays.
6984
6985 #### Returns
6986 *(Object)*:  Returns the new object.
6987
6988 #### Example
6989 ```js
6990 var object = { 'a': 1, 'b': '2', 'c': 3 };
6991
6992 _.omit(object, ['a', 'c']);
6993 // => { 'b': '2' }
6994 ```
6995 * * *
6996
6997 <!-- /div -->
6998
6999 <!-- div -->
7000
7001 ### <a id="_omitbyobject-predicate_identity"></a>`_.omitBy(object, [predicate=_.identity])`
7002 <a href="#_omitbyobject-predicate_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L11721 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.omitby "See the npm package")
7003
7004 The opposite of `_.pickBy`; this method creates an object composed of
7005 the own and inherited enumerable properties of `object` that `predicate`
7006 doesn't return truthy for. The predicate is invoked with two arguments:<br>
7007 (value, key).
7008
7009 #### Arguments
7010 1. `object` *(Object)*: The source object.
7011 2. `[predicate=_.identity]` *(Function|Object|string)*: The function invoked per property.
7012
7013 #### Returns
7014 *(Object)*:  Returns the new object.
7015
7016 #### Example
7017 ```js
7018 var object = { 'a': 1, 'b': '2', 'c': 3 };
7019
7020 _.omitBy(object, _.isNumber);
7021 // => { 'b': '2' }
7022 ```
7023 * * *
7024
7025 <!-- /div -->
7026
7027 <!-- div -->
7028
7029 ### <a id="_pickobject-props"></a>`_.pick(object, [props])`
7030 <a href="#_pickobject-props">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L11745 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.pick "See the npm package")
7031
7032 Creates an object composed of the picked `object` properties.
7033
7034 #### Arguments
7035 1. `object` *(Object)*: The source object.
7036 2. `[props]` *(...(string|string&#91;&#93;)*: The property names to pick, specified individually or in arrays.
7037
7038 #### Returns
7039 *(Object)*:  Returns the new object.
7040
7041 #### Example
7042 ```js
7043 var object = { 'a': 1, 'b': '2', 'c': 3 };
7044
7045 _.pick(object, ['a', 'c']);
7046 // => { 'a': 1, 'c': 3 }
7047 ```
7048 * * *
7049
7050 <!-- /div -->
7051
7052 <!-- div -->
7053
7054 ### <a id="_pickbyobject-predicate_identity"></a>`_.pickBy(object, [predicate=_.identity])`
7055 <a href="#_pickbyobject-predicate_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L11766 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.pickby "See the npm package")
7056
7057 Creates an object composed of the `object` properties `predicate` returns
7058 truthy for. The predicate is invoked with two arguments: (value, key).
7059
7060 #### Arguments
7061 1. `object` *(Object)*: The source object.
7062 2. `[predicate=_.identity]` *(Function|Object|string)*: The function invoked per property.
7063
7064 #### Returns
7065 *(Object)*:  Returns the new object.
7066
7067 #### Example
7068 ```js
7069 var object = { 'a': 1, 'b': '2', 'c': 3 };
7070
7071 _.pickBy(object, _.isNumber);
7072 // => { 'a': 1, 'c': 3 }
7073 ```
7074 * * *
7075
7076 <!-- /div -->
7077
7078 <!-- div -->
7079
7080 ### <a id="_resultobject-path-defaultvalue"></a>`_.result(object, path, [defaultValue])`
7081 <a href="#_resultobject-path-defaultvalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L11798 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.result "See the npm package")
7082
7083 This method is like `_.get` except that if the resolved value is a function
7084 it's invoked with the `this` binding of its parent object and its result
7085 is returned.
7086
7087 #### Arguments
7088 1. `object` *(Object)*: The object to query.
7089 2. `path` *(Array|string)*: The path of the property to resolve.
7090 3. `[defaultValue]` *(&#42;)*: The value returned if the resolved value is `undefined`.
7091
7092 #### Returns
7093 *(&#42;)*:  Returns the resolved value.
7094
7095 #### Example
7096 ```js
7097 var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };
7098
7099 _.result(object, 'a[0].b.c1');
7100 // => 3
7101
7102 _.result(object, 'a[0].b.c2');
7103 // => 4
7104
7105 _.result(object, 'a[0].b.c3', 'default');
7106 // => 'default'
7107
7108 _.result(object, 'a[0].b.c3', _.constant('default'));
7109 // => 'default'
7110 ```
7111 * * *
7112
7113 <!-- /div -->
7114
7115 <!-- div -->
7116
7117 ### <a id="_setobject-path-value"></a>`_.set(object, path, value)`
7118 <a href="#_setobject-path-value">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L11839 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.set "See the npm package")
7119
7120 Sets the value at `path` of `object`. If a portion of `path` doesn't exist
7121 it's created. Arrays are created for missing index properties while objects
7122 are created for all other missing properties. Use `_.setWith` to customize
7123 `path` creation.
7124 <br>
7125 <br>
7126 **Note:** This method mutates `object`.
7127
7128 #### Arguments
7129 1. `object` *(Object)*: The object to modify.
7130 2. `path` *(Array|string)*: The path of the property to set.
7131 3. `value` *(&#42;)*: The value to set.
7132
7133 #### Returns
7134 *(Object)*:  Returns `object`.
7135
7136 #### Example
7137 ```js
7138 var object = { 'a': [{ 'b': { 'c': 3 } }] };
7139
7140 _.set(object, 'a[0].b.c', 4);
7141 console.log(object.a[0].b.c);
7142 // => 4
7143
7144 _.set(object, 'x[0].y.z', 5);
7145 console.log(object.x[0].y.z);
7146 // => 5
7147 ```
7148 * * *
7149
7150 <!-- /div -->
7151
7152 <!-- div -->
7153
7154 ### <a id="_setwithobject-path-value-customizer"></a>`_.setWith(object, path, value, [customizer])`
7155 <a href="#_setwithobject-path-value-customizer">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L11864 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.setwith "See the npm package")
7156
7157 This method is like `_.set` except that it accepts `customizer` which is
7158 invoked to produce the objects of `path`.  If `customizer` returns `undefined`
7159 path creation is handled by the method instead. The `customizer` is invoked
7160 with three arguments: (nsValue, key, nsObject).
7161 <br>
7162 <br>
7163 **Note:** This method mutates `object`.
7164
7165 #### Arguments
7166 1. `object` *(Object)*: The object to modify.
7167 2. `path` *(Array|string)*: The path of the property to set.
7168 3. `value` *(&#42;)*: The value to set.
7169 4. `[customizer]` *(Function)*: The function to customize assigned values.
7170
7171 #### Returns
7172 *(Object)*:  Returns `object`.
7173
7174 #### Example
7175 ```js
7176 _.setWith({ '0': { 'length': 2 } }, '[0][1][2]', 3, Object);
7177 // => { '0': { '1': { '2': 3 }, 'length': 2 } }
7178 ```
7179 * * *
7180
7181 <!-- /div -->
7182
7183 <!-- div -->
7184
7185 ### <a id="_topairsobject"></a>`_.toPairs(object)`
7186 <a href="#_topairsobject">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L11890 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.topairs "See the npm package")
7187
7188 Creates an array of own enumerable key-value pairs for `object` which
7189 can be consumed by `_.fromPairs`.
7190
7191 #### Arguments
7192 1. `object` *(Object)*: The object to query.
7193
7194 #### Returns
7195 *(Array)*:  Returns the new array of key-value pairs.
7196
7197 #### Example
7198 ```js
7199 function Foo() {
7200   this.a = 1;
7201   this.b = 2;
7202 }
7203
7204 Foo.prototype.c = 3;
7205
7206 _.toPairs(new Foo);
7207 // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)
7208 ```
7209 * * *
7210
7211 <!-- /div -->
7212
7213 <!-- div -->
7214
7215 ### <a id="_topairsinobject"></a>`_.toPairsIn(object)`
7216 <a href="#_topairsinobject">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L11915 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.topairsin "See the npm package")
7217
7218 Creates an array of own and inherited enumerable key-value pairs for
7219 `object` which can be consumed by `_.fromPairs`.
7220
7221 #### Arguments
7222 1. `object` *(Object)*: The object to query.
7223
7224 #### Returns
7225 *(Array)*:  Returns the new array of key-value pairs.
7226
7227 #### Example
7228 ```js
7229 function Foo() {
7230   this.a = 1;
7231   this.b = 2;
7232 }
7233
7234 Foo.prototype.c = 3;
7235
7236 _.toPairsIn(new Foo);
7237 // => [['a', 1], ['b', 2], ['c', 1]] (iteration order is not guaranteed)
7238 ```
7239 * * *
7240
7241 <!-- /div -->
7242
7243 <!-- div -->
7244
7245 ### <a id="_transformobject-iteratee_identity-accumulator"></a>`_.transform(object, [iteratee=_.identity], [accumulator])`
7246 <a href="#_transformobject-iteratee_identity-accumulator">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L11947 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.transform "See the npm package")
7247
7248 An alternative to `_.reduce`; this method transforms `object` to a new
7249 `accumulator` object which is the result of running each of its own enumerable
7250 properties through `iteratee`, with each invocation potentially mutating
7251 the `accumulator` object. The iteratee is invoked with four arguments:<br>
7252 (accumulator, value, key, object). Iteratee functions may exit iteration
7253 early by explicitly returning `false`.
7254
7255 #### Arguments
7256 1. `object` *(Array|Object)*: The object to iterate over.
7257 2. `[iteratee=_.identity]` *(Function)*: The function invoked per iteration.
7258 3. `[accumulator]` *(&#42;)*: The custom accumulator value.
7259
7260 #### Returns
7261 *(&#42;)*:  Returns the accumulated value.
7262
7263 #### Example
7264 ```js
7265 _.transform([2, 3, 4], function(result, n) {
7266   result.push(n *= n);
7267   return n % 2 == 0;
7268 }, []);
7269 // => [4, 9]
7270
7271 _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
7272   (result[value] || (result[value] = [])).push(key);
7273 }, {});
7274 // => { '1': ['a', 'c'], '2': ['b'] }
7275 ```
7276 * * *
7277
7278 <!-- /div -->
7279
7280 <!-- div -->
7281
7282 ### <a id="_unsetobject-path"></a>`_.unset(object, path)`
7283 <a href="#_unsetobject-path">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L11995 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.unset "See the npm package")
7284
7285 Removes the property at `path` of `object`.
7286 <br>
7287 <br>
7288 **Note:** This method mutates `object`.
7289
7290 #### Arguments
7291 1. `object` *(Object)*: The object to modify.
7292 2. `path` *(Array|string)*: The path of the property to unset.
7293
7294 #### Returns
7295 *(boolean)*:  Returns `true` if the property is deleted, else `false`.
7296
7297 #### Example
7298 ```js
7299 var object = { 'a': [{ 'b': { 'c': 7 } }] };
7300 _.unset(object, 'a[0].b.c');
7301 // => true
7302
7303 console.log(object);
7304 // => { 'a': [{ 'b': {} }] };
7305
7306 _.unset(object, 'a[0].b.c');
7307 // => true
7308
7309 console.log(object);
7310 // => { 'a': [{ 'b': {} }] };
7311 ```
7312 * * *
7313
7314 <!-- /div -->
7315
7316 <!-- div -->
7317
7318 ### <a id="_valuesobject"></a>`_.values(object)`
7319 <a href="#_valuesobject">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L12024 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.values "See the npm package")
7320
7321 Creates an array of the own enumerable property values of `object`.
7322 <br>
7323 <br>
7324 **Note:** Non-object values are coerced to objects.
7325
7326 #### Arguments
7327 1. `object` *(Object)*: The object to query.
7328
7329 #### Returns
7330 *(Array)*:  Returns the array of property values.
7331
7332 #### Example
7333 ```js
7334 function Foo() {
7335   this.a = 1;
7336   this.b = 2;
7337 }
7338
7339 Foo.prototype.c = 3;
7340
7341 _.values(new Foo);
7342 // => [1, 2] (iteration order is not guaranteed)
7343
7344 _.values('hi');
7345 // => ['h', 'i']
7346 ```
7347 * * *
7348
7349 <!-- /div -->
7350
7351 <!-- div -->
7352
7353 ### <a id="_valuesinobject"></a>`_.valuesIn(object)`
7354 <a href="#_valuesinobject">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L12050 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.valuesin "See the npm package")
7355
7356 Creates an array of the own and inherited enumerable property values of `object`.
7357 <br>
7358 <br>
7359 **Note:** Non-object values are coerced to objects.
7360
7361 #### Arguments
7362 1. `object` *(Object)*: The object to query.
7363
7364 #### Returns
7365 *(Array)*:  Returns the array of property values.
7366
7367 #### Example
7368 ```js
7369 function Foo() {
7370   this.a = 1;
7371   this.b = 2;
7372 }
7373
7374 Foo.prototype.c = 3;
7375
7376 _.valuesIn(new Foo);
7377 // => [1, 2, 3] (iteration order is not guaranteed)
7378 ```
7379 * * *
7380
7381 <!-- /div -->
7382
7383 <!-- /div -->
7384
7385 <!-- div -->
7386
7387 ## `“Seq” Methods`
7388
7389 <!-- div -->
7390
7391 ### <a id="_value"></a>`_(value)`
7392 <a href="#_value">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L1500 "View in source") [&#x24C9;][1]
7393
7394 Creates a `lodash` object which wraps `value` to enable implicit method
7395 chaining. Methods that operate on and return arrays, collections, and
7396 functions can be chained together. Methods that retrieve a single value or
7397 may return a primitive value will automatically end the chain sequence and
7398 return the unwrapped value. Otherwise, the value must be unwrapped with
7399 `_#value`.
7400 <br>
7401 <br>
7402 Explicit chaining, which must be unwrapped with `_#value` in all cases,
7403 may be enabled using `_.chain`.
7404 <br>
7405 <br>
7406 The execution of chained methods is lazy, that is, it's deferred until
7407 `_#value` is implicitly or explicitly called.
7408 <br>
7409 <br>
7410 Lazy evaluation allows several methods to support shortcut fusion. Shortcut
7411 fusion is an optimization to merge iteratee calls; this avoids the creation
7412 of intermediate arrays and can greatly reduce the number of iteratee executions.
7413 Sections of a chain sequence qualify for shortcut fusion if the section is
7414 applied to an array of at least two hundred elements and any iteratees
7415 accept only one argument. The heuristic for whether a section qualifies
7416 for shortcut fusion is subject to change.
7417 <br>
7418 <br>
7419 Chaining is supported in custom builds as long as the `_#value` method is
7420 directly or indirectly included in the build.
7421 <br>
7422 <br>
7423 In addition to lodash methods, wrappers have `Array` and `String` methods.
7424 <br>
7425 <br>
7426 The wrapper `Array` methods are:<br>
7427 `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`
7428 <br>
7429 <br>
7430 The wrapper `String` methods are:<br>
7431 `replace` and `split`
7432 <br>
7433 <br>
7434 The wrapper methods that support shortcut fusion are:<br>
7435 `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,
7436 `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,
7437 `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`
7438 <br>
7439 <br>
7440 The chainable wrapper methods are:<br>
7441 `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,
7442 `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,
7443 `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,
7444 `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`, `difference`,
7445 `differenceBy`, `differenceWith`, `drop`, `dropRight`, `dropRightWhile`,
7446 `dropWhile`, `fill`, `filter`, `flatten`, `flattenDeep`, `flattenDepth`,
7447 `flip`, `flow`, `flowRight`, `fromPairs`, `functions`, `functionsIn`,
7448 `groupBy`, `initial`, `intersection`, `intersectionBy`, `intersectionWith`,
7449 `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`, `keys`, `keysIn`,
7450 `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`, `memoize`,
7451 `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`, `nthArg`,
7452 `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`, `overEvery`,
7453 `overSome`, `partial`, `partialRight`, `partition`, `pick`, `pickBy`, `plant`,
7454 `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`, `pullAt`, `push`,
7455 `range`, `rangeRight`, `rearg`, `reject`, `remove`, `rest`, `reverse`,
7456 `sampleSize`, `set`, `setWith`, `shuffle`, `slice`, `sort`, `sortBy`,
7457 `splice`, `spread`, `tail`, `take`, `takeRight`, `takeRightWhile`,
7458 `takeWhile`, `tap`, `throttle`, `thru`, `toArray`, `toPairs`, `toPairsIn`,
7459 `toPath`, `toPlainObject`, `transform`, `unary`, `union`, `unionBy`,
7460 `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`, `unshift`, `unzip`,
7461 `unzipWith`, `values`, `valuesIn`, `without`, `wrap`, `xor`, `xorBy`,
7462 `xorWith`, `zip`, `zipObject`, `zipObjectDeep`, and `zipWith`
7463 <br>
7464 <br>
7465 The wrapper methods that are **not** chainable by default are:<br>
7466 `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,
7467 `cloneDeep`, `cloneDeepWith`, `cloneWith`, `deburr`, `endsWith`, `eq`,
7468 `escape`, `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`,
7469 `findLastIndex`, `findLastKey`, `floor`, `forEach`, `forEachRight`, `forIn`,
7470 `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`, `hasIn`,
7471 `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`, `isArguments`,
7472 `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`, `isBoolean`,
7473 `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`, `isEqualWith`,
7474 `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`, `isMap`,
7475 `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`, `isNumber`,
7476 `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`, `isSafeInteger`,
7477 `isSet`, `isString`, `isUndefined`, `isTypedArray`, `isWeakMap`, `isWeakSet`,
7478 `join`, `kebabCase`, `last`, `lastIndexOf`, `lowerCase`, `lowerFirst`,
7479 `lt`, `lte`, `max`, `maxBy`, `mean`, `min`, `minBy`, `noConflict`, `noop`,
7480 `now`, `pad`, `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`,
7481 `reduceRight`, `repeat`, `result`, `round`, `runInContext`, `sample`,
7482 `shift`, `size`, `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`,
7483 `sortedLastIndex`, `sortedLastIndexBy`, `startCase`, `startsWith`, `subtract`,
7484 `sum`, `sumBy`, `template`, `times`, `toLower`, `toInteger`, `toLength`,
7485 `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`, `trimEnd`,
7486 `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`, `upperFirst`,
7487 `value`, and `words`
7488
7489 #### Arguments
7490 1. `value` *(&#42;)*: The value to wrap in a `lodash` instance.
7491
7492 #### Returns
7493 *(Object)*:  Returns the new `lodash` wrapper instance.
7494
7495 #### Example
7496 ```js
7497 function square(n) {
7498   return n * n;
7499 }
7500
7501 var wrapped = _([1, 2, 3]);
7502
7503 // Returns an unwrapped value.
7504 wrapped.reduce(_.add);
7505 // => 6
7506
7507 // Returns a wrapped value.
7508 var squares = wrapped.map(square);
7509
7510 _.isArray(squares);
7511 // => false
7512
7513 _.isArray(squares.value());
7514 // => true
7515 ```
7516 * * *
7517
7518 <!-- /div -->
7519
7520 <!-- div -->
7521
7522 ### <a id="_chainvalue"></a>`_.chain(value)`
7523 <a href="#_chainvalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L7205 "View in source") [&#x24C9;][1]
7524
7525 Creates a `lodash` object that wraps `value` with explicit method chaining enabled.
7526 The result of such method chaining must be unwrapped with `_#value`.
7527
7528 #### Arguments
7529 1. `value` *(&#42;)*: The value to wrap.
7530
7531 #### Returns
7532 *(Object)*:  Returns the new `lodash` wrapper instance.
7533
7534 #### Example
7535 ```js
7536 var users = [
7537   { 'user': 'barney',  'age': 36 },
7538   { 'user': 'fred',    'age': 40 },
7539   { 'user': 'pebbles', 'age': 1 }
7540 ];
7541
7542 var youngest = _
7543   .chain(users)
7544   .sortBy('age')
7545   .map(function(o) {
7546     return o.user + ' is ' + o.age;
7547   })
7548   .head()
7549   .value();
7550 // => 'pebbles is 1'
7551 ```
7552 * * *
7553
7554 <!-- /div -->
7555
7556 <!-- div -->
7557
7558 ### <a id="_tapvalue-interceptor"></a>`_.tap(value, interceptor)`
7559 <a href="#_tapvalue-interceptor">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L7233 "View in source") [&#x24C9;][1]
7560
7561 This method invokes `interceptor` and returns `value`. The interceptor
7562 is invoked with one argument; (value). The purpose of this method is to
7563 "tap into" a method chain in order to modify intermediate results.
7564
7565 #### Arguments
7566 1. `value` *(&#42;)*: The value to provide to `interceptor`.
7567 2. `interceptor` *(Function)*: The function to invoke.
7568
7569 #### Returns
7570 *(&#42;)*:  Returns `value`.
7571
7572 #### Example
7573 ```js
7574 _([1, 2, 3])
7575  .tap(function(array) {
7576    // Mutate input array.
7577    array.pop();
7578  })
7579  .reverse()
7580  .value();
7581 // => [2, 1]
7582 ```
7583 * * *
7584
7585 <!-- /div -->
7586
7587 <!-- div -->
7588
7589 ### <a id="_thruvalue-interceptor"></a>`_.thru(value, interceptor)`
7590 <a href="#_thruvalue-interceptor">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L7260 "View in source") [&#x24C9;][1]
7591
7592 This method is like `_.tap` except that it returns the result of `interceptor`.
7593 The purpose of this method is to "pass thru" values replacing intermediate
7594 results in a method chain.
7595
7596 #### Arguments
7597 1. `value` *(&#42;)*: The value to provide to `interceptor`.
7598 2. `interceptor` *(Function)*: The function to invoke.
7599
7600 #### Returns
7601 *(&#42;)*:  Returns the result of `interceptor`.
7602
7603 #### Example
7604 ```js
7605 _('  abc  ')
7606  .chain()
7607  .trim()
7608  .thru(function(value) {
7609    return [value];
7610  })
7611  .value();
7612 // => ['abc']
7613 ```
7614 * * *
7615
7616 <!-- /div -->
7617
7618 <!-- div -->
7619
7620 ### <a id="_prototypesymboliterator"></a>`_.prototype[Symbol.iterator]()`
7621 <a href="#_prototypesymboliterator">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L7436 "View in source") [&#x24C9;][1]
7622
7623 Enables the wrapper to be iterable.
7624
7625 #### Returns
7626 *(Object)*:  Returns the wrapper object.
7627
7628 #### Example
7629 ```js
7630 var wrapped = _([1, 2]);
7631
7632 wrapped[Symbol.iterator]() === wrapped;
7633 // => true
7634
7635 Array.from(wrapped);
7636 // => [1, 2]
7637 ```
7638 * * *
7639
7640 <!-- /div -->
7641
7642 <!-- div -->
7643
7644 ### <a id="_prototypeatpaths"></a>`_.prototype.at([paths])`
7645 <a href="#_prototypeatpaths">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L7283 "View in source") [&#x24C9;][1]
7646
7647 This method is the wrapper version of `_.at`.
7648
7649 #### Arguments
7650 1. `[paths]` *(...(string|string&#91;&#93;)*: The property paths of elements to pick, specified individually or in arrays.
7651
7652 #### Returns
7653 *(Object)*:  Returns the new `lodash` wrapper instance.
7654
7655 #### Example
7656 ```js
7657 var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
7658
7659 _(object).at(['a[0].b.c', 'a[1]']).value();
7660 // => [3, 4]
7661
7662 _(['a', 'b', 'c']).at(0, 2).value();
7663 // => ['a', 'c']
7664 ```
7665 * * *
7666
7667 <!-- /div -->
7668
7669 <!-- div -->
7670
7671 ### <a id="_prototypechain"></a>`_.prototype.chain()`
7672 <a href="#_prototypechain">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L7334 "View in source") [&#x24C9;][1]
7673
7674 Enables explicit method chaining on the wrapper object.
7675
7676 #### Returns
7677 *(Object)*:  Returns the new `lodash` wrapper instance.
7678
7679 #### Example
7680 ```js
7681 var users = [
7682   { 'user': 'barney', 'age': 36 },
7683   { 'user': 'fred',   'age': 40 }
7684 ];
7685
7686 // A sequence without explicit chaining.
7687 _(users).head();
7688 // => { 'user': 'barney', 'age': 36 }
7689
7690 // A sequence with explicit chaining.
7691 _(users)
7692   .chain()
7693   .head()
7694   .pick('user')
7695   .value();
7696 // => { 'user': 'barney' }
7697 ```
7698 * * *
7699
7700 <!-- /div -->
7701
7702 <!-- div -->
7703
7704 ### <a id="_prototypecommit"></a>`_.prototype.commit()`
7705 <a href="#_prototypecommit">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L7363 "View in source") [&#x24C9;][1]
7706
7707 Executes the chained sequence and returns the wrapped result.
7708
7709 #### Returns
7710 *(Object)*:  Returns the new `lodash` wrapper instance.
7711
7712 #### Example
7713 ```js
7714 var array = [1, 2];
7715 var wrapped = _(array).push(3);
7716
7717 console.log(array);
7718 // => [1, 2]
7719
7720 wrapped = wrapped.commit();
7721 console.log(array);
7722 // => [1, 2, 3]
7723
7724 wrapped.last();
7725 // => 3
7726
7727 console.log(array);
7728 // => [1, 2, 3]
7729 ```
7730 * * *
7731
7732 <!-- /div -->
7733
7734 <!-- div -->
7735
7736 ### <a id="_prototypeflatmapiteratee_identity"></a>`_.prototype.flatMap([iteratee=_.identity])`
7737 <a href="#_prototypeflatmapiteratee_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L7384 "View in source") [&#x24C9;][1]
7738
7739 This method is the wrapper version of `_.flatMap`.
7740
7741 #### Arguments
7742 1. `[iteratee=_.identity]` *(Function|Object|string)*: The function invoked per iteration.
7743
7744 #### Returns
7745 *(Object)*:  Returns the new `lodash` wrapper instance.
7746
7747 #### Example
7748 ```js
7749 function duplicate(n) {
7750   return [n, n];
7751 }
7752
7753 _([1, 2]).flatMap(duplicate).value();
7754 // => [1, 1, 2, 2]
7755 ```
7756 * * *
7757
7758 <!-- /div -->
7759
7760 <!-- div -->
7761
7762 ### <a id="_prototypenext"></a>`_.prototype.next()`
7763 <a href="#_prototypenext">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L7409 "View in source") [&#x24C9;][1]
7764
7765 Gets the next value on a wrapped object following the
7766 [iterator protocol](https://mdn.io/iteration_protocols#iterator).
7767
7768 #### Returns
7769 *(Object)*:  Returns the next iterator value.
7770
7771 #### Example
7772 ```js
7773 var wrapped = _([1, 2]);
7774
7775 wrapped.next();
7776 // => { 'done': false, 'value': 1 }
7777
7778 wrapped.next();
7779 // => { 'done': false, 'value': 2 }
7780
7781 wrapped.next();
7782 // => { 'done': true, 'value': undefined }
7783 ```
7784 * * *
7785
7786 <!-- /div -->
7787
7788 <!-- div -->
7789
7790 ### <a id="_prototypeplantvalue"></a>`_.prototype.plant(value)`
7791 <a href="#_prototypeplantvalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L7463 "View in source") [&#x24C9;][1]
7792
7793 Creates a clone of the chained sequence planting `value` as the wrapped value.
7794
7795 #### Arguments
7796 1. `value` *(&#42;)*: The value to plant.
7797
7798 #### Returns
7799 *(Object)*:  Returns the new `lodash` wrapper instance.
7800
7801 #### Example
7802 ```js
7803 function square(n) {
7804   return n * n;
7805 }
7806
7807 var wrapped = _([1, 2]).map(square);
7808 var other = wrapped.plant([3, 4]);
7809
7810 other.value();
7811 // => [9, 16]
7812
7813 wrapped.value();
7814 // => [1, 4]
7815 ```
7816 * * *
7817
7818 <!-- /div -->
7819
7820 <!-- div -->
7821
7822 ### <a id="_prototypereverse"></a>`_.prototype.reverse()`
7823 <a href="#_prototypereverse">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L7502 "View in source") [&#x24C9;][1]
7824
7825 This method is the wrapper version of `_.reverse`.
7826 <br>
7827 <br>
7828 **Note:** This method mutates the wrapped array.
7829
7830 #### Returns
7831 *(Object)*:  Returns the new `lodash` wrapper instance.
7832
7833 #### Example
7834 ```js
7835 var array = [1, 2, 3];
7836
7837 _(array).reverse().value()
7838 // => [3, 2, 1]
7839
7840 console.log(array);
7841 // => [3, 2, 1]
7842 ```
7843 * * *
7844
7845 <!-- /div -->
7846
7847 <!-- div -->
7848
7849 ### <a id="_prototypevalue"></a>`_.prototype.value()`
7850 <a href="#_prototypevalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L7533 "View in source") [&#x24C9;][1]
7851
7852 Executes the chained sequence to extract the unwrapped value.
7853
7854 #### Aliases
7855 *_.prototype.toJSON, _.prototype.valueOf*
7856
7857 #### Returns
7858 *(&#42;)*:  Returns the resolved unwrapped value.
7859
7860 #### Example
7861 ```js
7862 _([1, 2, 3]).value();
7863 // => [1, 2, 3]
7864 ```
7865 * * *
7866
7867 <!-- /div -->
7868
7869 <!-- /div -->
7870
7871 <!-- div -->
7872
7873 ## `“String” Methods`
7874
7875 <!-- div -->
7876
7877 ### <a id="_camelcasestring"></a>`_.camelCase([string=''])`
7878 <a href="#_camelcasestring">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L12228 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.camelcase "See the npm package")
7879
7880 Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).
7881
7882 #### Arguments
7883 1. `[string='']` *(string)*: The string to convert.
7884
7885 #### Returns
7886 *(string)*:  Returns the camel cased string.
7887
7888 #### Example
7889 ```js
7890 _.camelCase('Foo Bar');
7891 // => 'fooBar'
7892
7893 _.camelCase('--foo-bar');
7894 // => 'fooBar'
7895
7896 _.camelCase('__foo_bar__');
7897 // => 'fooBar'
7898 ```
7899 * * *
7900
7901 <!-- /div -->
7902
7903 <!-- div -->
7904
7905 ### <a id="_capitalizestring"></a>`_.capitalize([string=''])`
7906 <a href="#_capitalizestring">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L12247 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.capitalize "See the npm package")
7907
7908 Converts the first character of `string` to upper case and the remaining
7909 to lower case.
7910
7911 #### Arguments
7912 1. `[string='']` *(string)*: The string to capitalize.
7913
7914 #### Returns
7915 *(string)*:  Returns the capitalized string.
7916
7917 #### Example
7918 ```js
7919 _.capitalize('FRED');
7920 // => 'Fred'
7921 ```
7922 * * *
7923
7924 <!-- /div -->
7925
7926 <!-- div -->
7927
7928 ### <a id="_deburrstring"></a>`_.deburr([string=''])`
7929 <a href="#_deburrstring">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L12265 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.deburr "See the npm package")
7930
7931 Deburrs `string` by converting [latin-1 supplementary letters](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)
7932 to basic latin letters and removing [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
7933
7934 #### Arguments
7935 1. `[string='']` *(string)*: The string to deburr.
7936
7937 #### Returns
7938 *(string)*:  Returns the deburred string.
7939
7940 #### Example
7941 ```js
7942 _.deburr('déjà vu');
7943 // => 'deja vu'
7944 ```
7945 * * *
7946
7947 <!-- /div -->
7948
7949 <!-- div -->
7950
7951 ### <a id="_endswithstring-target-positionstringlength"></a>`_.endsWith([string=''], [target], [position=string.length])`
7952 <a href="#_endswithstring-target-positionstringlength">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L12291 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.endswith "See the npm package")
7953
7954 Checks if `string` ends with the given target string.
7955
7956 #### Arguments
7957 1. `[string='']` *(string)*: The string to search.
7958 2. `[target]` *(string)*: The string to search for.
7959 3. `[position=string.length]` *(number)*: The position to search from.
7960
7961 #### Returns
7962 *(boolean)*:  Returns `true` if `string` ends with `target`, else `false`.
7963
7964 #### Example
7965 ```js
7966 _.endsWith('abc', 'c');
7967 // => true
7968
7969 _.endsWith('abc', 'b');
7970 // => false
7971
7972 _.endsWith('abc', 'b', 2);
7973 // => true
7974 ```
7975 * * *
7976
7977 <!-- /div -->
7978
7979 <!-- div -->
7980
7981 ### <a id="_escapestring"></a>`_.escape([string=''])`
7982 <a href="#_escapestring">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L12336 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.escape "See the npm package")
7983
7984 Converts the characters "&", "<", ">", '"', "'", and "\`" in `string` to
7985 their corresponding HTML entities.
7986 <br>
7987 <br>
7988 **Note:** No other characters are escaped. To escape additional
7989 characters use a third-party library like [_he_](https://mths.be/he).
7990 <br>
7991 <br>
7992 Though the ">" character is escaped for symmetry, characters like
7993 ">" and "/" don't need escaping in HTML and have no special meaning
7994 unless they're part of a tag or unquoted attribute value.
7995 See [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)
7996 (under "semi-related fun fact") for more details.
7997 <br>
7998 <br>
7999 Backticks are escaped because in IE < 9, they can break out of
8000 attribute values or HTML comments. See [#59](https://html5sec.org/#59),
8001 [#102](https://html5sec.org/#102), [#108](https://html5sec.org/#108), and
8002 [#133](https://html5sec.org/#133) of the [HTML5 Security Cheatsheet](https://html5sec.org/)
8003 for more details.
8004 <br>
8005 <br>
8006 When working with HTML you should always [quote attribute values](http://wonko.com/post/html-escaping)
8007 to reduce XSS vectors.
8008
8009 #### Arguments
8010 1. `[string='']` *(string)*: The string to escape.
8011
8012 #### Returns
8013 *(string)*:  Returns the escaped string.
8014
8015 #### Example
8016 ```js
8017 _.escape('fred, barney, & pebbles');
8018 // => 'fred, barney, &amp; pebbles'
8019 ```
8020 * * *
8021
8022 <!-- /div -->
8023
8024 <!-- div -->
8025
8026 ### <a id="_escaperegexpstring"></a>`_.escapeRegExp([string=''])`
8027 <a href="#_escaperegexpstring">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L12357 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.escaperegexp "See the npm package")
8028
8029 Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+",
8030 "?", "(", ")", "[", "]", "{", "}", and "|" in `string`.
8031
8032 #### Arguments
8033 1. `[string='']` *(string)*: The string to escape.
8034
8035 #### Returns
8036 *(string)*:  Returns the escaped string.
8037
8038 #### Example
8039 ```js
8040 _.escapeRegExp('[lodash](https://lodash.com/)');
8041 // => '\[lodash\]\(https://lodash\.com/\)'
8042 ```
8043 * * *
8044
8045 <!-- /div -->
8046
8047 <!-- div -->
8048
8049 ### <a id="_kebabcasestring"></a>`_.kebabCase([string=''])`
8050 <a href="#_kebabcasestring">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L12383 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.kebabcase "See the npm package")
8051
8052 Converts `string` to [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).
8053
8054 #### Arguments
8055 1. `[string='']` *(string)*: The string to convert.
8056
8057 #### Returns
8058 *(string)*:  Returns the kebab cased string.
8059
8060 #### Example
8061 ```js
8062 _.kebabCase('Foo Bar');
8063 // => 'foo-bar'
8064
8065 _.kebabCase('fooBar');
8066 // => 'foo-bar'
8067
8068 _.kebabCase('__foo_bar__');
8069 // => 'foo-bar'
8070 ```
8071 * * *
8072
8073 <!-- /div -->
8074
8075 <!-- div -->
8076
8077 ### <a id="_lowercasestring"></a>`_.lowerCase([string=''])`
8078 <a href="#_lowercasestring">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L12406 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.lowercase "See the npm package")
8079
8080 Converts `string`, as space separated words, to lower case.
8081
8082 #### Arguments
8083 1. `[string='']` *(string)*: The string to convert.
8084
8085 #### Returns
8086 *(string)*:  Returns the lower cased string.
8087
8088 #### Example
8089 ```js
8090 _.lowerCase('--Foo-Bar');
8091 // => 'foo bar'
8092
8093 _.lowerCase('fooBar');
8094 // => 'foo bar'
8095
8096 _.lowerCase('__FOO_BAR__');
8097 // => 'foo bar'
8098 ```
8099 * * *
8100
8101 <!-- /div -->
8102
8103 <!-- div -->
8104
8105 ### <a id="_lowerfirststring"></a>`_.lowerFirst([string=''])`
8106 <a href="#_lowerfirststring">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L12426 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.lowerfirst "See the npm package")
8107
8108 Converts the first character of `string` to lower case.
8109
8110 #### Arguments
8111 1. `[string='']` *(string)*: The string to convert.
8112
8113 #### Returns
8114 *(string)*:  Returns the converted string.
8115
8116 #### Example
8117 ```js
8118 _.lowerFirst('Fred');
8119 // => 'fred'
8120
8121 _.lowerFirst('FRED');
8122 // => 'fRED'
8123 ```
8124 * * *
8125
8126 <!-- /div -->
8127
8128 <!-- div -->
8129
8130 ### <a id="_padstring-length0-chars"></a>`_.pad([string=''], [length=0], [chars=' '])`
8131 <a href="#_padstring-length0-chars">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L12468 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.pad "See the npm package")
8132
8133 Pads `string` on the left and right sides if it's shorter than `length`.
8134 Padding characters are truncated if they can't be evenly divided by `length`.
8135
8136 #### Arguments
8137 1. `[string='']` *(string)*: The string to pad.
8138 2. `[length=0]` *(number)*: The padding length.
8139 3. `[chars=' ']` *(string)*: The string used as padding.
8140
8141 #### Returns
8142 *(string)*:  Returns the padded string.
8143
8144 #### Example
8145 ```js
8146 _.pad('abc', 8);
8147 // => '  abc   '
8148
8149 _.pad('abc', 8, '_-');
8150 // => '_-abc_-_'
8151
8152 _.pad('abc', 3);
8153 // => 'abc'
8154 ```
8155 * * *
8156
8157 <!-- /div -->
8158
8159 <!-- div -->
8160
8161 ### <a id="_padendstring-length0-chars"></a>`_.padEnd([string=''], [length=0], [chars=' '])`
8162 <a href="#_padendstring-length0-chars">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L12505 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.padend "See the npm package")
8163
8164 Pads `string` on the right side if it's shorter than `length`. Padding
8165 characters are truncated if they exceed `length`.
8166
8167 #### Arguments
8168 1. `[string='']` *(string)*: The string to pad.
8169 2. `[length=0]` *(number)*: The padding length.
8170 3. `[chars=' ']` *(string)*: The string used as padding.
8171
8172 #### Returns
8173 *(string)*:  Returns the padded string.
8174
8175 #### Example
8176 ```js
8177 _.padEnd('abc', 6);
8178 // => 'abc   '
8179
8180 _.padEnd('abc', 6, '_-');
8181 // => 'abc_-_'
8182
8183 _.padEnd('abc', 3);
8184 // => 'abc'
8185 ```
8186 * * *
8187
8188 <!-- /div -->
8189
8190 <!-- div -->
8191
8192 ### <a id="_padstartstring-length0-chars"></a>`_.padStart([string=''], [length=0], [chars=' '])`
8193 <a href="#_padstartstring-length0-chars">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L12532 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.padstart "See the npm package")
8194
8195 Pads `string` on the left side if it's shorter than `length`. Padding
8196 characters are truncated if they exceed `length`.
8197
8198 #### Arguments
8199 1. `[string='']` *(string)*: The string to pad.
8200 2. `[length=0]` *(number)*: The padding length.
8201 3. `[chars=' ']` *(string)*: The string used as padding.
8202
8203 #### Returns
8204 *(string)*:  Returns the padded string.
8205
8206 #### Example
8207 ```js
8208 _.padStart('abc', 6);
8209 // => '   abc'
8210
8211 _.padStart('abc', 6, '_-');
8212 // => '_-_abc'
8213
8214 _.padStart('abc', 3);
8215 // => 'abc'
8216 ```
8217 * * *
8218
8219 <!-- /div -->
8220
8221 <!-- div -->
8222
8223 ### <a id="_parseintstring-radix10"></a>`_.parseInt(string, [radix=10])`
8224 <a href="#_parseintstring-radix10">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L12560 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.parseint "See the npm package")
8225
8226 Converts `string` to an integer of the specified radix. If `radix` is
8227 `undefined` or `0`, a `radix` of `10` is used unless `value` is a hexadecimal,
8228 in which case a `radix` of `16` is used.
8229 <br>
8230 <br>
8231 **Note:** This method aligns with the [ES5 implementation](https://es5.github.io/#x15.1.2.2)
8232 of `parseInt`.
8233
8234 #### Arguments
8235 1. `string` *(string)*: The string to convert.
8236 2. `[radix=10]` *(number)*: The radix to interpret `value` by.
8237
8238 #### Returns
8239 *(number)*:  Returns the converted integer.
8240
8241 #### Example
8242 ```js
8243 _.parseInt('08');
8244 // => 8
8245
8246 _.map(['6', '08', '10'], _.parseInt);
8247 // => [6, 8, 10]
8248 ```
8249 * * *
8250
8251 <!-- /div -->
8252
8253 <!-- div -->
8254
8255 ### <a id="_repeatstring-n0"></a>`_.repeat([string=''], [n=0])`
8256 <a href="#_repeatstring-n0">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L12592 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.repeat "See the npm package")
8257
8258 Repeats the given string `n` times.
8259
8260 #### Arguments
8261 1. `[string='']` *(string)*: The string to repeat.
8262 2. `[n=0]` *(number)*: The number of times to repeat the string.
8263
8264 #### Returns
8265 *(string)*:  Returns the repeated string.
8266
8267 #### Example
8268 ```js
8269 _.repeat('*', 3);
8270 // => '***'
8271
8272 _.repeat('abc', 2);
8273 // => 'abcabc'
8274
8275 _.repeat('abc', 0);
8276 // => ''
8277 ```
8278 * * *
8279
8280 <!-- /div -->
8281
8282 <!-- div -->
8283
8284 ### <a id="_replacestring-pattern-replacement"></a>`_.replace([string=''], pattern, replacement)`
8285 <a href="#_replacestring-pattern-replacement">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L12630 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.replace "See the npm package")
8286
8287 Replaces matches for `pattern` in `string` with `replacement`.
8288 <br>
8289 <br>
8290 **Note:** This method is based on [`String#replace`](https://mdn.io/String/replace).
8291
8292 #### Arguments
8293 1. `[string='']` *(string)*: The string to modify.
8294 2. `pattern` *(RegExp|string)*: The pattern to replace.
8295 3. `replacement` *(Function|string)*: The match replacement.
8296
8297 #### Returns
8298 *(string)*:  Returns the modified string.
8299
8300 #### Example
8301 ```js
8302 _.replace('Hi Fred', 'Fred', 'Barney');
8303 // => 'Hi Barney'
8304 ```
8305 * * *
8306
8307 <!-- /div -->
8308
8309 <!-- div -->
8310
8311 ### <a id="_snakecasestring"></a>`_.snakeCase([string=''])`
8312 <a href="#_snakecasestring">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L12656 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.snakecase "See the npm package")
8313
8314 Converts `string` to [snake case](https://en.wikipedia.org/wiki/Snake_case).
8315
8316 #### Arguments
8317 1. `[string='']` *(string)*: The string to convert.
8318
8319 #### Returns
8320 *(string)*:  Returns the snake cased string.
8321
8322 #### Example
8323 ```js
8324 _.snakeCase('Foo Bar');
8325 // => 'foo_bar'
8326
8327 _.snakeCase('fooBar');
8328 // => 'foo_bar'
8329
8330 _.snakeCase('--foo-bar');
8331 // => 'foo_bar'
8332 ```
8333 * * *
8334
8335 <!-- /div -->
8336
8337 <!-- div -->
8338
8339 ### <a id="_splitstring-separator-limit"></a>`_.split([string=''], separator, [limit])`
8340 <a href="#_splitstring-separator-limit">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L12677 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.split "See the npm package")
8341
8342 Splits `string` by `separator`.
8343 <br>
8344 <br>
8345 **Note:** This method is based on [`String#split`](https://mdn.io/String/split).
8346
8347 #### Arguments
8348 1. `[string='']` *(string)*: The string to split.
8349 2. `separator` *(RegExp|string)*: The separator pattern to split by.
8350 3. `[limit]` *(number)*: The length to truncate results to.
8351
8352 #### Returns
8353 *(Array)*:  Returns the new array of string segments.
8354
8355 #### Example
8356 ```js
8357 _.split('a-b-c', '-', 2);
8358 // => ['a', 'b']
8359 ```
8360 * * *
8361
8362 <!-- /div -->
8363
8364 <!-- div -->
8365
8366 ### <a id="_startcasestring"></a>`_.startCase([string=''])`
8367 <a href="#_startcasestring">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L12700 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.startcase "See the npm package")
8368
8369 Converts `string` to [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).
8370
8371 #### Arguments
8372 1. `[string='']` *(string)*: The string to convert.
8373
8374 #### Returns
8375 *(string)*:  Returns the start cased string.
8376
8377 #### Example
8378 ```js
8379 _.startCase('--foo-bar');
8380 // => 'Foo Bar'
8381
8382 _.startCase('fooBar');
8383 // => 'Foo Bar'
8384
8385 _.startCase('__foo_bar__');
8386 // => 'Foo Bar'
8387 ```
8388 * * *
8389
8390 <!-- /div -->
8391
8392 <!-- div -->
8393
8394 ### <a id="_startswithstring-target-position0"></a>`_.startsWith([string=''], [target], [position=0])`
8395 <a href="#_startswithstring-target-position0">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L12725 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.startswith "See the npm package")
8396
8397 Checks if `string` starts with the given target string.
8398
8399 #### Arguments
8400 1. `[string='']` *(string)*: The string to search.
8401 2. `[target]` *(string)*: The string to search for.
8402 3. `[position=0]` *(number)*: The position to search from.
8403
8404 #### Returns
8405 *(boolean)*:  Returns `true` if `string` starts with `target`, else `false`.
8406
8407 #### Example
8408 ```js
8409 _.startsWith('abc', 'a');
8410 // => true
8411
8412 _.startsWith('abc', 'b');
8413 // => false
8414
8415 _.startsWith('abc', 'b', 1);
8416 // => true
8417 ```
8418 * * *
8419
8420 <!-- /div -->
8421
8422 <!-- div -->
8423
8424 ### <a id="_templatestring-options"></a>`_.template([string=''], [options])`
8425 <a href="#_templatestring-options">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L12827 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.template "See the npm package")
8426
8427 Creates a compiled template function that can interpolate data properties
8428 in "interpolate" delimiters, HTML-escape interpolated data properties in
8429 "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data
8430 properties may be accessed as free variables in the template. If a setting
8431 object is given it takes precedence over `_.templateSettings` values.
8432 <br>
8433 <br>
8434 **Note:** In the development build `_.template` utilizes
8435 [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)
8436 for easier debugging.
8437 <br>
8438 <br>
8439 For more information on precompiling templates see
8440 [lodash's custom builds documentation](https://lodash.com/custom-builds).
8441 <br>
8442 <br>
8443 For more information on Chrome extension sandboxes see
8444 [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).
8445
8446 #### Arguments
8447 1. `[string='']` *(string)*: The template string.
8448 2. `[options]` *(Object)*: The options object.
8449 3. `[options.escape]` *(RegExp)*: The HTML "escape" delimiter.
8450 4. `[options.evaluate]` *(RegExp)*: The "evaluate" delimiter.
8451 5. `[options.imports]` *(Object)*: An object to import into the template as free variables.
8452 6. `[options.interpolate]` *(RegExp)*: The "interpolate" delimiter.
8453 7. `[options.sourceURL]` *(string)*: The sourceURL of the template's compiled source.
8454 8. `[options.variable]` *(string)*: The data object variable name.
8455
8456 #### Returns
8457 *(Function)*:  Returns the compiled template function.
8458
8459 #### Example
8460 ```js
8461 // Use the "interpolate" delimiter to create a compiled template.
8462 var compiled = _.template('hello <%= user %>!');
8463 compiled({ 'user': 'fred' });
8464 // => 'hello fred!'
8465
8466 // Use the HTML "escape" delimiter to escape data property values.
8467 var compiled = _.template('<b><%- value %></b>');
8468 compiled({ 'value': '<script>' });
8469 // => '<b>&lt;script&gt;</b>'
8470
8471 // Use the "evaluate" delimiter to execute JavaScript and generate HTML.
8472 var compiled = _.template('<% _.forEach(users, function(user) { %><li><%- user %></li><% }); %>');
8473 compiled({ 'users': ['fred', 'barney'] });
8474 // => '<li>fred</li><li>barney</li>'
8475
8476 // Use the internal `print` function in "evaluate" delimiters.
8477 var compiled = _.template('<% print("hello " + user); %>!');
8478 compiled({ 'user': 'barney' });
8479 // => 'hello barney!'
8480
8481 // Use the ES delimiter as an alternative to the default "interpolate" delimiter.
8482 var compiled = _.template('hello ${ user }!');
8483 compiled({ 'user': 'pebbles' });
8484 // => 'hello pebbles!'
8485
8486 // Use custom template delimiters.
8487 _.templateSettings.interpolate = /{{([\s\S]+?)}}/g;
8488 var compiled = _.template('hello {{ user }}!');
8489 compiled({ 'user': 'mustache' });
8490 // => 'hello mustache!'
8491
8492 // Use backslashes to treat delimiters as plain text.
8493 var compiled = _.template('<%= "\\<%- value %\\>" %>');
8494 compiled({ 'value': 'ignored' });
8495 // => '<%- value %>'
8496
8497 // Use the `imports` option to import `jQuery` as `jq`.
8498 var text = '<% jq.each(users, function(user) { %><li><%- user %></li><% }); %>';
8499 var compiled = _.template(text, { 'imports': { 'jq': jQuery } });
8500 compiled({ 'users': ['fred', 'barney'] });
8501 // => '<li>fred</li><li>barney</li>'
8502
8503 // Use the `sourceURL` option to specify a custom sourceURL for the template.
8504 var compiled = _.template('hello <%= user %>!', { 'sourceURL': '/basic/greeting.jst' });
8505 compiled(data);
8506 // => find the source of "greeting.jst" under the Sources tab or Resources panel of the web inspector
8507
8508 // Use the `variable` option to ensure a with-statement isn't used in the compiled template.
8509 var compiled = _.template('hi <%= data.user %>!', { 'variable': 'data' });
8510 compiled.source;
8511 // => function(data) {
8512 //   var __t, __p = '';
8513 //   __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!';
8514 //   return __p;
8515 // }
8516
8517 // Use the `source` property to inline compiled templates for meaningful
8518 // line numbers in error messages and stack traces.
8519 fs.writeFileSync(path.join(cwd, 'jst.js'), '\
8520   var JST = {\
8521     "main": ' + _.template(mainText).source + '\
8522   };\
8523 ');
8524 ```
8525 * * *
8526
8527 <!-- /div -->
8528
8529 <!-- div -->
8530
8531 ### <a id="_tolowerstring"></a>`_.toLower([string=''])`
8532 <a href="#_tolowerstring">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L12953 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.tolower "See the npm package")
8533
8534 Converts `string`, as a whole, to lower case.
8535
8536 #### Arguments
8537 1. `[string='']` *(string)*: The string to convert.
8538
8539 #### Returns
8540 *(string)*:  Returns the lower cased string.
8541
8542 #### Example
8543 ```js
8544 _.toLower('--Foo-Bar');
8545 // => '--foo-bar'
8546
8547 _.toLower('fooBar');
8548 // => 'foobar'
8549
8550 _.toLower('__FOO_BAR__');
8551 // => '__foo_bar__'
8552 ```
8553 * * *
8554
8555 <!-- /div -->
8556
8557 <!-- div -->
8558
8559 ### <a id="_toupperstring"></a>`_.toUpper([string=''])`
8560 <a href="#_toupperstring">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L12976 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.toupper "See the npm package")
8561
8562 Converts `string`, as a whole, to upper case.
8563
8564 #### Arguments
8565 1. `[string='']` *(string)*: The string to convert.
8566
8567 #### Returns
8568 *(string)*:  Returns the upper cased string.
8569
8570 #### Example
8571 ```js
8572 _.toUpper('--foo-bar');
8573 // => '--FOO-BAR'
8574
8575 _.toUpper('fooBar');
8576 // => 'FOOBAR'
8577
8578 _.toUpper('__foo_bar__');
8579 // => '__FOO_BAR__'
8580 ```
8581 * * *
8582
8583 <!-- /div -->
8584
8585 <!-- div -->
8586
8587 ### <a id="_trimstring-charswhitespace"></a>`_.trim([string=''], [chars=whitespace])`
8588 <a href="#_trimstring-charswhitespace">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L13001 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.trim "See the npm package")
8589
8590 Removes leading and trailing whitespace or specified characters from `string`.
8591
8592 #### Arguments
8593 1. `[string='']` *(string)*: The string to trim.
8594 2. `[chars=whitespace]` *(string)*: The characters to trim.
8595
8596 #### Returns
8597 *(string)*:  Returns the trimmed string.
8598
8599 #### Example
8600 ```js
8601 _.trim('  abc  ');
8602 // => 'abc'
8603
8604 _.trim('-_-abc-_-', '_-');
8605 // => 'abc'
8606
8607 _.map(['  foo  ', '  bar  '], _.trim);
8608 // => ['foo', 'bar']
8609 ```
8610 * * *
8611
8612 <!-- /div -->
8613
8614 <!-- div -->
8615
8616 ### <a id="_trimendstring-charswhitespace"></a>`_.trimEnd([string=''], [chars=whitespace])`
8617 <a href="#_trimendstring-charswhitespace">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L13039 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.trimend "See the npm package")
8618
8619 Removes trailing whitespace or specified characters from `string`.
8620
8621 #### Arguments
8622 1. `[string='']` *(string)*: The string to trim.
8623 2. `[chars=whitespace]` *(string)*: The characters to trim.
8624
8625 #### Returns
8626 *(string)*:  Returns the trimmed string.
8627
8628 #### Example
8629 ```js
8630 _.trimEnd('  abc  ');
8631 // => '  abc'
8632
8633 _.trimEnd('-_-abc-_-', '_-');
8634 // => '-_-abc'
8635 ```
8636 * * *
8637
8638 <!-- /div -->
8639
8640 <!-- div -->
8641
8642 ### <a id="_trimstartstring-charswhitespace"></a>`_.trimStart([string=''], [chars=whitespace])`
8643 <a href="#_trimstartstring-charswhitespace">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L13075 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.trimstart "See the npm package")
8644
8645 Removes leading whitespace or specified characters from `string`.
8646
8647 #### Arguments
8648 1. `[string='']` *(string)*: The string to trim.
8649 2. `[chars=whitespace]` *(string)*: The characters to trim.
8650
8651 #### Returns
8652 *(string)*:  Returns the trimmed string.
8653
8654 #### Example
8655 ```js
8656 _.trimStart('  abc  ');
8657 // => 'abc  '
8658
8659 _.trimStart('-_-abc-_-', '_-');
8660 // => 'abc-_-'
8661 ```
8662 * * *
8663
8664 <!-- /div -->
8665
8666 <!-- div -->
8667
8668 ### <a id="_truncatestring-options-optionslength30-optionsomission-optionsseparator"></a>`_.truncate([string=''], [options=({})], [options.length=30], [options.omission='...'], [options.separator])`
8669 <a href="#_truncatestring-options-optionslength30-optionsomission-optionsseparator">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L13129 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.truncate "See the npm package")
8670
8671 Truncates `string` if it's longer than the given maximum string length.
8672 The last characters of the truncated string are replaced with the omission
8673 string which defaults to "...".
8674
8675 #### Arguments
8676 1. `[string='']` *(string)*: The string to truncate.
8677 2. `[options=({})]` *(Object)*: The options object.
8678 3. `[options.length=30]` *(number)*: The maximum string length.
8679 4. `[options.omission='...']` *(string)*: The string to indicate text is omitted.
8680 5. `[options.separator]` *(RegExp|string)*: The separator pattern to truncate to.
8681
8682 #### Returns
8683 *(string)*:  Returns the truncated string.
8684
8685 #### Example
8686 ```js
8687 _.truncate('hi-diddly-ho there, neighborino');
8688 // => 'hi-diddly-ho there, neighbo...'
8689
8690 _.truncate('hi-diddly-ho there, neighborino', {
8691   'length': 24,
8692   'separator': ' '
8693 });
8694 // => 'hi-diddly-ho there,...'
8695
8696 _.truncate('hi-diddly-ho there, neighborino', {
8697   'length': 24,
8698   'separator': /,? +/
8699 });
8700 // => 'hi-diddly-ho there...'
8701
8702 _.truncate('hi-diddly-ho there, neighborino', {
8703   'omission': ' [...]'
8704 });
8705 // => 'hi-diddly-ho there, neig [...]'
8706 ```
8707 * * *
8708
8709 <!-- /div -->
8710
8711 <!-- div -->
8712
8713 ### <a id="_unescapestring"></a>`_.unescape([string=''])`
8714 <a href="#_unescapestring">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L13203 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.unescape "See the npm package")
8715
8716 The inverse of `_.escape`; this method converts the HTML entities
8717 `&amp;`, `&lt;`, `&gt;`, `&quot;`, `&#39;`, and `&#96;` in `string` to their
8718 corresponding characters.
8719 <br>
8720 <br>
8721 **Note:** No other HTML entities are unescaped. To unescape additional HTML
8722 entities use a third-party library like [_he_](https://mths.be/he).
8723
8724 #### Arguments
8725 1. `[string='']` *(string)*: The string to unescape.
8726
8727 #### Returns
8728 *(string)*:  Returns the unescaped string.
8729
8730 #### Example
8731 ```js
8732 _.unescape('fred, barney, &amp; pebbles');
8733 // => 'fred, barney, & pebbles'
8734 ```
8735 * * *
8736
8737 <!-- /div -->
8738
8739 <!-- div -->
8740
8741 ### <a id="_uppercasestring"></a>`_.upperCase([string=''])`
8742 <a href="#_uppercasestring">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L13229 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.uppercase "See the npm package")
8743
8744 Converts `string`, as space separated words, to upper case.
8745
8746 #### Arguments
8747 1. `[string='']` *(string)*: The string to convert.
8748
8749 #### Returns
8750 *(string)*:  Returns the upper cased string.
8751
8752 #### Example
8753 ```js
8754 _.upperCase('--foo-bar');
8755 // => 'FOO BAR'
8756
8757 _.upperCase('fooBar');
8758 // => 'FOO BAR'
8759
8760 _.upperCase('__foo_bar__');
8761 // => 'FOO BAR'
8762 ```
8763 * * *
8764
8765 <!-- /div -->
8766
8767 <!-- div -->
8768
8769 ### <a id="_upperfirststring"></a>`_.upperFirst([string=''])`
8770 <a href="#_upperfirststring">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L12444 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.upperfirst "See the npm package")
8771
8772 Converts the first character of `string` to upper case.
8773
8774 #### Arguments
8775 1. `[string='']` *(string)*: The string to convert.
8776
8777 #### Returns
8778 *(string)*:  Returns the converted string.
8779
8780 #### Example
8781 ```js
8782 _.upperFirst('fred');
8783 // => 'Fred'
8784
8785 _.upperFirst('FRED');
8786 // => 'FRED'
8787 ```
8788 * * *
8789
8790 <!-- /div -->
8791
8792 <!-- div -->
8793
8794 ### <a id="_wordsstring-pattern"></a>`_.words([string=''], [pattern])`
8795 <a href="#_wordsstring-pattern">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L13251 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.words "See the npm package")
8796
8797 Splits `string` into an array of its words.
8798
8799 #### Arguments
8800 1. `[string='']` *(string)*: The string to inspect.
8801 2. `[pattern]` *(RegExp|string)*: The pattern to match words.
8802
8803 #### Returns
8804 *(Array)*:  Returns the words of `string`.
8805
8806 #### Example
8807 ```js
8808 _.words('fred, barney, & pebbles');
8809 // => ['fred', 'barney', 'pebbles']
8810
8811 _.words('fred, barney, & pebbles', /[^, ]+/g);
8812 // => ['fred', 'barney', '&', 'pebbles']
8813 ```
8814 * * *
8815
8816 <!-- /div -->
8817
8818 <!-- /div -->
8819
8820 <!-- div -->
8821
8822 ## `“Util” Methods`
8823
8824 <!-- div -->
8825
8826 ### <a id="_attemptfunc"></a>`_.attempt(func)`
8827 <a href="#_attemptfunc">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L13283 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.attempt "See the npm package")
8828
8829 Attempts to invoke `func`, returning either the result or the caught error
8830 object. Any additional arguments are provided to `func` when it's invoked.
8831
8832 #### Arguments
8833 1. `func` *(Function)*: The function to attempt.
8834
8835 #### Returns
8836 *(&#42;)*:  Returns the `func` result or error object.
8837
8838 #### Example
8839 ```js
8840 // Avoid throwing errors for invalid selectors.
8841 var elements = _.attempt(function(selector) {
8842   return document.querySelectorAll(selector);
8843 }, '>_>');
8844
8845 if (_.isError(elements)) {
8846   elements = [];
8847 }
8848 ```
8849 * * *
8850
8851 <!-- /div -->
8852
8853 <!-- div -->
8854
8855 ### <a id="_bindallobject-methodnames"></a>`_.bindAll(object, methodNames)`
8856 <a href="#_bindallobject-methodnames">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L13317 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.bindall "See the npm package")
8857
8858 Binds methods of an object to the object itself, overwriting the existing
8859 method.
8860 <br>
8861 <br>
8862 **Note:** This method doesn't set the "length" property of bound functions.
8863
8864 #### Arguments
8865 1. `object` *(Object)*: The object to bind and assign the bound methods to.
8866 2. `methodNames` *(...(string|string&#91;&#93;)*: The object method names to bind, specified individually or in arrays.
8867
8868 #### Returns
8869 *(Object)*:  Returns `object`.
8870
8871 #### Example
8872 ```js
8873 var view = {
8874   'label': 'docs',
8875   'onClick': function() {
8876     console.log('clicked ' + this.label);
8877   }
8878 };
8879
8880 _.bindAll(view, 'onClick');
8881 jQuery(element).on('click', view.onClick);
8882 // => logs 'clicked docs' when clicked
8883 ```
8884 * * *
8885
8886 <!-- /div -->
8887
8888 <!-- div -->
8889
8890 ### <a id="_condpairs"></a>`_.cond(pairs)`
8891 <a href="#_condpairs">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L13352 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.cond "See the npm package")
8892
8893 Creates a function that iterates over `pairs` invoking the corresponding
8894 function of the first predicate to return truthy. The predicate-function
8895 pairs are invoked with the `this` binding and arguments of the created
8896 function.
8897
8898 #### Arguments
8899 1. `pairs` *(Array)*: The predicate-function pairs.
8900
8901 #### Returns
8902 *(Function)*:  Returns the new function.
8903
8904 #### Example
8905 ```js
8906 var func = _.cond([
8907   [_.matches({ 'a': 1 }),           _.constant('matches A')],
8908   [_.conforms({ 'b': _.isNumber }), _.constant('matches B')],
8909   [_.constant(true),                _.constant('no match')]
8910 ]);
8911
8912 func({ 'a': 1, 'b': 2 });
8913 // => 'matches A'
8914
8915 func({ 'a': 0, 'b': 1 });
8916 // => 'matches B'
8917
8918 func({ 'a': '1', 'b': '2' });
8919 // => 'no match'
8920 ```
8921 * * *
8922
8923 <!-- /div -->
8924
8925 <!-- div -->
8926
8927 ### <a id="_conformssource"></a>`_.conforms(source)`
8928 <a href="#_conformssource">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L13394 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.conforms "See the npm package")
8929
8930 Creates a function that invokes the predicate properties of `source` with
8931 the corresponding property values of a given object, returning `true` if
8932 all predicates return truthy, else `false`.
8933
8934 #### Arguments
8935 1. `source` *(Object)*: The object of property predicates to conform to.
8936
8937 #### Returns
8938 *(Function)*:  Returns the new function.
8939
8940 #### Example
8941 ```js
8942 var users = [
8943   { 'user': 'barney', 'age': 36 },
8944   { 'user': 'fred',   'age': 40 }
8945 ];
8946
8947 _.filter(users, _.conforms({ 'age': _.partial(_.gt, _, 38) }));
8948 // => [{ 'user': 'fred', 'age': 40 }]
8949 ```
8950 * * *
8951
8952 <!-- /div -->
8953
8954 <!-- div -->
8955
8956 ### <a id="_constantvalue"></a>`_.constant(value)`
8957 <a href="#_constantvalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L13414 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.constant "See the npm package")
8958
8959 Creates a function that returns `value`.
8960
8961 #### Arguments
8962 1. `value` *(&#42;)*: The value to return from the new function.
8963
8964 #### Returns
8965 *(Function)*:  Returns the new function.
8966
8967 #### Example
8968 ```js
8969 var object = { 'user': 'fred' };
8970 var getter = _.constant(object);
8971
8972 getter() === object;
8973 // => true
8974 ```
8975 * * *
8976
8977 <!-- /div -->
8978
8979 <!-- div -->
8980
8981 ### <a id="_flowfuncs"></a>`_.flow([funcs])`
8982 <a href="#_flowfuncs">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L13440 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.flow "See the npm package")
8983
8984 Creates a function that returns the result of invoking the given functions
8985 with the `this` binding of the created function, where each successive
8986 invocation is supplied the return value of the previous.
8987
8988 #### Arguments
8989 1. `[funcs]` *(...(Function|Function&#91;&#93;)*: Functions to invoke.
8990
8991 #### Returns
8992 *(Function)*:  Returns the new function.
8993
8994 #### Example
8995 ```js
8996 function square(n) {
8997   return n * n;
8998 }
8999
9000 var addSquare = _.flow(_.add, square);
9001 addSquare(1, 2);
9002 // => 9
9003 ```
9004 * * *
9005
9006 <!-- /div -->
9007
9008 <!-- div -->
9009
9010 ### <a id="_flowrightfuncs"></a>`_.flowRight([funcs])`
9011 <a href="#_flowrightfuncs">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L13461 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.flowright "See the npm package")
9012
9013 This method is like `_.flow` except that it creates a function that
9014 invokes the given functions from right to left.
9015
9016 #### Arguments
9017 1. `[funcs]` *(...(Function|Function&#91;&#93;)*: Functions to invoke.
9018
9019 #### Returns
9020 *(Function)*:  Returns the new function.
9021
9022 #### Example
9023 ```js
9024 function square(n) {
9025   return n * n;
9026 }
9027
9028 var addSquare = _.flowRight(square, _.add);
9029 addSquare(1, 2);
9030 // => 9
9031 ```
9032 * * *
9033
9034 <!-- /div -->
9035
9036 <!-- div -->
9037
9038 ### <a id="_identityvalue"></a>`_.identity(value)`
9039 <a href="#_identityvalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L13478 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.identity "See the npm package")
9040
9041 This method returns the first argument given to it.
9042
9043 #### Arguments
9044 1. `value` *(&#42;)*: Any value.
9045
9046 #### Returns
9047 *(&#42;)*:  Returns `value`.
9048
9049 #### Example
9050 ```js
9051 var object = { 'user': 'fred' };
9052
9053 _.identity(object) === object;
9054 // => true
9055 ```
9056 * * *
9057
9058 <!-- /div -->
9059
9060 <!-- div -->
9061
9062 ### <a id="_iterateefunc_identity"></a>`_.iteratee([func=_.identity])`
9063 <a href="#_iterateefunc_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L13512 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.iteratee "See the npm package")
9064
9065 Creates a function that invokes `func` with the arguments of the created
9066 function. If `func` is a property name the created callback returns the
9067 property value for a given element. If `func` is an object the created
9068 callback returns `true` for elements that contain the equivalent object
9069 properties, otherwise it returns `false`.
9070
9071 #### Arguments
9072 1. `[func=_.identity]` *(&#42;)*: The value to convert to a callback.
9073
9074 #### Returns
9075 *(Function)*:  Returns the callback.
9076
9077 #### Example
9078 ```js
9079 var users = [
9080   { 'user': 'barney', 'age': 36 },
9081   { 'user': 'fred',   'age': 40 }
9082 ];
9083
9084 // Create custom iteratee shorthands.
9085 _.iteratee = _.wrap(_.iteratee, function(callback, func) {
9086   var p = /^(\S+)\s*([<>])\s*(\S+)$/.exec(func);
9087   return !p ? callback(func) : function(object) {
9088     return (p[2] == '>' ? object[p[1]] > p[3] : object[p[1]] < p[3]);
9089   };
9090 });
9091
9092 _.filter(users, 'age > 36');
9093 // => [{ 'user': 'fred', 'age': 40 }]
9094 ```
9095 * * *
9096
9097 <!-- /div -->
9098
9099 <!-- div -->
9100
9101 ### <a id="_matchessource"></a>`_.matches(source)`
9102 <a href="#_matchessource">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L13539 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.matches "See the npm package")
9103
9104 Creates a function that performs a partial deep comparison between a given
9105 object and `source`, returning `true` if the given object has equivalent
9106 property values, else `false`. The created function is equivalent to
9107 `_.isMatch` with a `source` partially applied.
9108 <br>
9109 <br>
9110 **Note:** This method supports comparing the same values as `_.isEqual`.
9111
9112 #### Arguments
9113 1. `source` *(Object)*: The object of property values to match.
9114
9115 #### Returns
9116 *(Function)*:  Returns the new function.
9117
9118 #### Example
9119 ```js
9120 var users = [
9121   { 'user': 'barney', 'age': 36, 'active': true },
9122   { 'user': 'fred',   'age': 40, 'active': false }
9123 ];
9124
9125 _.filter(users, _.matches({ 'age': 40, 'active': false }));
9126 // => [{ 'user': 'fred', 'age': 40, 'active': false }]
9127 ```
9128 * * *
9129
9130 <!-- /div -->
9131
9132 <!-- div -->
9133
9134 ### <a id="_matchespropertypath-srcvalue"></a>`_.matchesProperty(path, srcValue)`
9135 <a href="#_matchespropertypath-srcvalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L13566 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.matchesproperty "See the npm package")
9136
9137 Creates a function that performs a partial deep comparison between the
9138 value at `path` of a given object to `srcValue`, returning `true` if the
9139 object value is equivalent, else `false`.
9140 <br>
9141 <br>
9142 **Note:** This method supports comparing the same values as `_.isEqual`.
9143
9144 #### Arguments
9145 1. `path` *(Array|string)*: The path of the property to get.
9146 2. `srcValue` *(&#42;)*: The value to match.
9147
9148 #### Returns
9149 *(Function)*:  Returns the new function.
9150
9151 #### Example
9152 ```js
9153 var users = [
9154   { 'user': 'barney' },
9155   { 'user': 'fred' }
9156 ];
9157
9158 _.find(users, _.matchesProperty('user', 'fred'));
9159 // => { 'user': 'fred' }
9160 ```
9161 * * *
9162
9163 <!-- /div -->
9164
9165 <!-- div -->
9166
9167 ### <a id="_methodpath-args"></a>`_.method(path, [args])`
9168 <a href="#_methodpath-args">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L13593 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.method "See the npm package")
9169
9170 Creates a function that invokes the method at `path` of a given object.
9171 Any additional arguments are provided to the invoked method.
9172
9173 #### Arguments
9174 1. `path` *(Array|string)*: The path of the method to invoke.
9175 2. `[args]` *(...&#42;)*: The arguments to invoke the method with.
9176
9177 #### Returns
9178 *(Function)*:  Returns the new function.
9179
9180 #### Example
9181 ```js
9182 var objects = [
9183   { 'a': { 'b': { 'c': _.constant(2) } } },
9184   { 'a': { 'b': { 'c': _.constant(1) } } }
9185 ];
9186
9187 _.map(objects, _.method('a.b.c'));
9188 // => [2, 1]
9189
9190 _.invokeMap(_.sortBy(objects, _.method(['a', 'b', 'c'])), 'a.b.c');
9191 // => [1, 2]
9192 ```
9193 * * *
9194
9195 <!-- /div -->
9196
9197 <!-- div -->
9198
9199 ### <a id="_methodofobject-args"></a>`_.methodOf(object, [args])`
9200 <a href="#_methodofobject-args">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L13621 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.methodof "See the npm package")
9201
9202 The opposite of `_.method`; this method creates a function that invokes
9203 the method at a given path of `object`. Any additional arguments are
9204 provided to the invoked method.
9205
9206 #### Arguments
9207 1. `object` *(Object)*: The object to query.
9208 2. `[args]` *(...&#42;)*: The arguments to invoke the method with.
9209
9210 #### Returns
9211 *(Function)*:  Returns the new function.
9212
9213 #### Example
9214 ```js
9215 var array = _.times(3, _.constant),
9216     object = { 'a': array, 'b': array, 'c': array };
9217
9218 _.map(['a[2]', 'c[0]'], _.methodOf(object));
9219 // => [2, 0]
9220
9221 _.map([['a', '2'], ['c', '0']], _.methodOf(object));
9222 // => [2, 0]
9223 ```
9224 * * *
9225
9226 <!-- /div -->
9227
9228 <!-- div -->
9229
9230 ### <a id="_mixinobjectlodash-source-options"></a>`_.mixin([object=lodash], source, [options])`
9231 <a href="#_mixinobjectlodash-source-options">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L13663 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.mixin "See the npm package")
9232
9233 Adds all own enumerable function properties of a source object to the
9234 destination object. If `object` is a function then methods are added to
9235 its prototype as well.
9236 <br>
9237 <br>
9238 **Note:** Use `_.runInContext` to create a pristine `lodash` function to
9239 avoid conflicts caused by modifying the original.
9240
9241 #### Arguments
9242 1. `[object=lodash]` *(Function|Object)*: The destination object.
9243 2. `source` *(Object)*: The object of functions to add.
9244 3. `[options]` *(Object)*: The options object.
9245 4. `[options.chain=true]` *(boolean)*: Specify whether the functions added are chainable.
9246
9247 #### Returns
9248 *(Function|Object)*:  Returns `object`.
9249
9250 #### Example
9251 ```js
9252 function vowels(string) {
9253   return _.filter(string, function(v) {
9254     return /[aeiou]/i.test(v);
9255   });
9256 }
9257
9258 _.mixin({ 'vowels': vowels });
9259 _.vowels('fred');
9260 // => ['e']
9261
9262 _('fred').vowels().value();
9263 // => ['e']
9264
9265 _.mixin({ 'vowels': vowels }, { 'chain': false });
9266 _('fred').vowels();
9267 // => ['e']
9268 ```
9269 * * *
9270
9271 <!-- /div -->
9272
9273 <!-- div -->
9274
9275 ### <a id="_noconflict"></a>`_.noConflict()`
9276 <a href="#_noconflict">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L13711 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.noconflict "See the npm package")
9277
9278 Reverts the `_` variable to its previous value and returns a reference to
9279 the `lodash` function.
9280
9281 #### Returns
9282 *(Function)*:  Returns the `lodash` function.
9283
9284 #### Example
9285 ```js
9286 var lodash = _.noConflict();
9287 ```
9288 * * *
9289
9290 <!-- /div -->
9291
9292 <!-- div -->
9293
9294 ### <a id="_noop"></a>`_.noop()`
9295 <a href="#_noop">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L13732 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.noop "See the npm package")
9296
9297 A no-operation function that returns `undefined` regardless of the
9298 arguments it receives.
9299
9300 #### Example
9301 ```js
9302 var object = { 'user': 'fred' };
9303
9304 _.noop(object) === undefined;
9305 // => true
9306 ```
9307 * * *
9308
9309 <!-- /div -->
9310
9311 <!-- div -->
9312
9313 ### <a id="_nthargn0"></a>`_.nthArg([n=0])`
9314 <a href="#_nthargn0">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L13751 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.ntharg "See the npm package")
9315
9316 Creates a function that returns its nth argument.
9317
9318 #### Arguments
9319 1. `[n=0]` *(number)*: The index of the argument to return.
9320
9321 #### Returns
9322 *(Function)*:  Returns the new function.
9323
9324 #### Example
9325 ```js
9326 var func = _.nthArg(1);
9327
9328 func('a', 'b', 'c');
9329 // => 'b'
9330 ```
9331 * * *
9332
9333 <!-- /div -->
9334
9335 <!-- div -->
9336
9337 ### <a id="_overiteratees"></a>`_.over(iteratees)`
9338 <a href="#_overiteratees">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L13774 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.over "See the npm package")
9339
9340 Creates a function that invokes `iteratees` with the arguments provided
9341 to the created function and returns their results.
9342
9343 #### Arguments
9344 1. `iteratees` *(...(Function|Function&#91;&#93;)*: The iteratees to invoke.
9345
9346 #### Returns
9347 *(Function)*:  Returns the new function.
9348
9349 #### Example
9350 ```js
9351 var func = _.over(Math.max, Math.min);
9352
9353 func(1, 2, 3, 4);
9354 // => [4, 1]
9355 ```
9356 * * *
9357
9358 <!-- /div -->
9359
9360 <!-- div -->
9361
9362 ### <a id="_overeverypredicates"></a>`_.overEvery(predicates)`
9363 <a href="#_overeverypredicates">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L13798 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.overevery "See the npm package")
9364
9365 Creates a function that checks if **all** of the `predicates` return
9366 truthy when invoked with the arguments provided to the created function.
9367
9368 #### Arguments
9369 1. `predicates` *(...(Function|Function&#91;&#93;)*: The predicates to check.
9370
9371 #### Returns
9372 *(Function)*:  Returns the new function.
9373
9374 #### Example
9375 ```js
9376 var func = _.overEvery(Boolean, isFinite);
9377
9378 func('1');
9379 // => true
9380
9381 func(null);
9382 // => false
9383
9384 func(NaN);
9385 // => false
9386 ```
9387 * * *
9388
9389 <!-- /div -->
9390
9391 <!-- div -->
9392
9393 ### <a id="_oversomepredicates"></a>`_.overSome(predicates)`
9394 <a href="#_oversomepredicates">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L13822 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.oversome "See the npm package")
9395
9396 Creates a function that checks if **any** of the `predicates` return
9397 truthy when invoked with the arguments provided to the created function.
9398
9399 #### Arguments
9400 1. `predicates` *(...(Function|Function&#91;&#93;)*: The predicates to check.
9401
9402 #### Returns
9403 *(Function)*:  Returns the new function.
9404
9405 #### Example
9406 ```js
9407 var func = _.overSome(Boolean, isFinite);
9408
9409 func('1');
9410 // => true
9411
9412 func(null);
9413 // => true
9414
9415 func(NaN);
9416 // => false
9417 ```
9418 * * *
9419
9420 <!-- /div -->
9421
9422 <!-- div -->
9423
9424 ### <a id="_propertypath"></a>`_.property(path)`
9425 <a href="#_propertypath">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L13845 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.property "See the npm package")
9426
9427 Creates a function that returns the value at `path` of a given object.
9428
9429 #### Arguments
9430 1. `path` *(Array|string)*: The path of the property to get.
9431
9432 #### Returns
9433 *(Function)*:  Returns the new function.
9434
9435 #### Example
9436 ```js
9437 var objects = [
9438   { 'a': { 'b': { 'c': 2 } } },
9439   { 'a': { 'b': { 'c': 1 } } }
9440 ];
9441
9442 _.map(objects, _.property('a.b.c'));
9443 // => [2, 1]
9444
9445 _.map(_.sortBy(objects, _.property(['a', 'b', 'c'])), 'a.b.c');
9446 // => [1, 2]
9447 ```
9448 * * *
9449
9450 <!-- /div -->
9451
9452 <!-- div -->
9453
9454 ### <a id="_propertyofobject"></a>`_.propertyOf(object)`
9455 <a href="#_propertyofobject">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L13869 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.propertyof "See the npm package")
9456
9457 The opposite of `_.property`; this method creates a function that returns
9458 the value at a given path of `object`.
9459
9460 #### Arguments
9461 1. `object` *(Object)*: The object to query.
9462
9463 #### Returns
9464 *(Function)*:  Returns the new function.
9465
9466 #### Example
9467 ```js
9468 var array = [0, 1, 2],
9469     object = { 'a': array, 'b': array, 'c': array };
9470
9471 _.map(['a[2]', 'c[0]'], _.propertyOf(object));
9472 // => [2, 0]
9473
9474 _.map([['a', '2'], ['c', '0']], _.propertyOf(object));
9475 // => [2, 0]
9476 ```
9477 * * *
9478
9479 <!-- /div -->
9480
9481 <!-- div -->
9482
9483 ### <a id="_rangestart0-end-step1"></a>`_.range([start=0], end, [step=1])`
9484 <a href="#_rangestart0-end-step1">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L13914 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.range "See the npm package")
9485
9486 Creates an array of numbers (positive and/or negative) progressing from
9487 `start` up to, but not including, `end`. A step of `-1` is used if a negative
9488 `start` is specified without an `end` or `step`. If `end` is not specified
9489 it's set to `start` with `start` then set to `0`.
9490 <br>
9491 <br>
9492 **Note:** JavaScript follows the IEEE-754 standard for resolving
9493 floating-point values which can produce unexpected results.
9494
9495 #### Arguments
9496 1. `[start=0]` *(number)*: The start of the range.
9497 2. `end` *(number)*: The end of the range.
9498 3. `[step=1]` *(number)*: The value to increment or decrement by.
9499
9500 #### Returns
9501 *(Array)*:  Returns the new array of numbers.
9502
9503 #### Example
9504 ```js
9505 _.range(4);
9506 // => [0, 1, 2, 3]
9507
9508 _.range(-4);
9509 // => [0, -1, -2, -3]
9510
9511 _.range(1, 5);
9512 // => [1, 2, 3, 4]
9513
9514 _.range(0, 20, 5);
9515 // => [0, 5, 10, 15]
9516
9517 _.range(0, -4, -1);
9518 // => [0, -1, -2, -3]
9519
9520 _.range(1, 4, 0);
9521 // => [1, 1, 1]
9522
9523 _.range(0);
9524 // => []
9525 ```
9526 * * *
9527
9528 <!-- /div -->
9529
9530 <!-- div -->
9531
9532 ### <a id="_rangerightstart0-end-step1"></a>`_.rangeRight([start=0], end, [step=1])`
9533 <a href="#_rangerightstart0-end-step1">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L13950 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.rangeright "See the npm package")
9534
9535 This method is like `_.range` except that it populates values in
9536 descending order.
9537
9538 #### Arguments
9539 1. `[start=0]` *(number)*: The start of the range.
9540 2. `end` *(number)*: The end of the range.
9541 3. `[step=1]` *(number)*: The value to increment or decrement by.
9542
9543 #### Returns
9544 *(Array)*:  Returns the new array of numbers.
9545
9546 #### Example
9547 ```js
9548 _.rangeRight(4);
9549 // => [3, 2, 1, 0]
9550
9551 _.rangeRight(-4);
9552 // => [-3, -2, -1, 0]
9553
9554 _.rangeRight(1, 5);
9555 // => [4, 3, 2, 1]
9556
9557 _.rangeRight(0, 20, 5);
9558 // => [15, 10, 5, 0]
9559
9560 _.rangeRight(0, -4, -1);
9561 // => [-3, -2, -1, 0]
9562
9563 _.rangeRight(1, 4, 0);
9564 // => [1, 1, 1]
9565
9566 _.rangeRight(0);
9567 // => []
9568 ```
9569 * * *
9570
9571 <!-- /div -->
9572
9573 <!-- div -->
9574
9575 ### <a id="_runincontextcontextroot"></a>`_.runInContext([context=root])`
9576 <a href="#_runincontextcontextroot">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L1296 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.runincontext "See the npm package")
9577
9578 Create a new pristine `lodash` function using the `context` object.
9579
9580 #### Arguments
9581 1. `[context=root]` *(Object)*: The context object.
9582
9583 #### Returns
9584 *(Function)*:  Returns a new `lodash` function.
9585
9586 #### Example
9587 ```js
9588 _.mixin({ 'foo': _.constant('foo') });
9589
9590 var lodash = _.runInContext();
9591 lodash.mixin({ 'bar': lodash.constant('bar') });
9592
9593 _.isFunction(_.foo);
9594 // => true
9595 _.isFunction(_.bar);
9596 // => false
9597
9598 lodash.isFunction(lodash.foo);
9599 // => false
9600 lodash.isFunction(lodash.bar);
9601 // => true
9602
9603 // Use `context` to mock `Date#getTime` use in `_.now`.
9604 var mock = _.runInContext({
9605   'Date': function() {
9606     return { 'getTime': getTimeMock };
9607   }
9608 });
9609
9610 // Create a suped-up `defer` in Node.js.
9611 var defer = _.runInContext({ 'setTimeout': setImmediate }).defer;
9612 ```
9613 * * *
9614
9615 <!-- /div -->
9616
9617 <!-- div -->
9618
9619 ### <a id="_timesn-iteratee_identity"></a>`_.times(n, [iteratee=_.identity])`
9620 <a href="#_timesn-iteratee_identity">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L13970 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.times "See the npm package")
9621
9622 Invokes the iteratee `n` times, returning an array of the results of
9623 each invocation. The iteratee is invoked with one argument; (index).
9624
9625 #### Arguments
9626 1. `n` *(number)*: The number of times to invoke `iteratee`.
9627 2. `[iteratee=_.identity]` *(Function)*: The function invoked per iteration.
9628
9629 #### Returns
9630 *(Array)*:  Returns the array of results.
9631
9632 #### Example
9633 ```js
9634 _.times(3, String);
9635 // => ['0', '1', '2']
9636
9637  _.times(4, _.constant(true));
9638 // => [true, true, true, true]
9639 ```
9640 * * *
9641
9642 <!-- /div -->
9643
9644 <!-- div -->
9645
9646 ### <a id="_topathvalue"></a>`_.toPath(value)`
9647 <a href="#_topathvalue">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L14013 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.topath "See the npm package")
9648
9649 Converts `value` to a property path array.
9650
9651 #### Arguments
9652 1. `value` *(&#42;)*: The value to convert.
9653
9654 #### Returns
9655 *(Array)*:  Returns the new property path array.
9656
9657 #### Example
9658 ```js
9659 _.toPath('a.b.c');
9660 // => ['a', 'b', 'c']
9661
9662 _.toPath('a[0].b.c');
9663 // => ['a', '0', 'b', 'c']
9664
9665 var path = ['a', 'b', 'c'],
9666     newPath = _.toPath(path);
9667
9668 console.log(newPath);
9669 // => ['a', 'b', 'c']
9670
9671 console.log(path === newPath);
9672 // => false
9673 ```
9674 * * *
9675
9676 <!-- /div -->
9677
9678 <!-- div -->
9679
9680 ### <a id="_uniqueidprefix"></a>`_.uniqueId([prefix=''])`
9681 <a href="#_uniqueidprefix">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L14033 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.uniqueid "See the npm package")
9682
9683 Generates a unique ID. If `prefix` is given the ID is appended to it.
9684
9685 #### Arguments
9686 1. `[prefix='']` *(string)*: The value to prefix the ID with.
9687
9688 #### Returns
9689 *(string)*:  Returns the unique ID.
9690
9691 #### Example
9692 ```js
9693 _.uniqueId('contact_');
9694 // => 'contact_104'
9695
9696 _.uniqueId();
9697 // => '105'
9698 ```
9699 * * *
9700
9701 <!-- /div -->
9702
9703 <!-- /div -->
9704
9705 <!-- div -->
9706
9707 ## `Properties`
9708
9709 <!-- div -->
9710
9711 ### <a id="_version"></a>`_.VERSION`
9712 <a href="#_version">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L14680 "View in source") [&#x24C9;][1]
9713
9714 ({string}): The semantic version number.
9715
9716 * * *
9717
9718 <!-- /div -->
9719
9720 <!-- div -->
9721
9722 ### <a id="_templatesettings"></a>`_.templateSettings`
9723 <a href="#_templatesettings">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L1545 "View in source") [&#x24C9;][1] [&#x24C3;](https://www.npmjs.com/package/lodash.templatesettings "See the npm package")
9724
9725 ({Object}): By default, the template delimiters used by lodash are like those in
9726 embedded Ruby (ERB). Change the following template settings to use
9727 alternative delimiters.
9728
9729 * * *
9730
9731 <!-- /div -->
9732
9733 <!-- div -->
9734
9735 ### <a id="_templatesettingsescape"></a>`_.templateSettings.escape`
9736 <a href="#_templatesettingsescape">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L1553 "View in source") [&#x24C9;][1]
9737
9738 ({RegExp}): Used to detect `data` property values to be HTML-escaped.
9739
9740 * * *
9741
9742 <!-- /div -->
9743
9744 <!-- div -->
9745
9746 ### <a id="_templatesettingsevaluate"></a>`_.templateSettings.evaluate`
9747 <a href="#_templatesettingsevaluate">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L1561 "View in source") [&#x24C9;][1]
9748
9749 ({RegExp}): Used to detect code to be evaluated.
9750
9751 * * *
9752
9753 <!-- /div -->
9754
9755 <!-- div -->
9756
9757 ### <a id="_templatesettingsimports"></a>`_.templateSettings.imports`
9758 <a href="#_templatesettingsimports">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L1585 "View in source") [&#x24C9;][1]
9759
9760 ({Object}): Used to import variables into the compiled template.
9761
9762 * * *
9763
9764 <!-- /div -->
9765
9766 <!-- div -->
9767
9768 ### <a id="_templatesettingsimports_"></a>`_.templateSettings.imports._`
9769 <a href="#_templatesettingsimports_">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L1593 "View in source") [&#x24C9;][1]
9770
9771 ({Function}): A reference to the `lodash` function.
9772
9773 * * *
9774
9775 <!-- /div -->
9776
9777 <!-- div -->
9778
9779 ### <a id="_templatesettingsinterpolate"></a>`_.templateSettings.interpolate`
9780 <a href="#_templatesettingsinterpolate">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L1569 "View in source") [&#x24C9;][1]
9781
9782 ({RegExp}): Used to detect `data` property values to inject.
9783
9784 * * *
9785
9786 <!-- /div -->
9787
9788 <!-- div -->
9789
9790 ### <a id="_templatesettingsvariable"></a>`_.templateSettings.variable`
9791 <a href="#_templatesettingsvariable">#</a> [&#x24C8;](https://github.com/lodash/lodash/blob/4.5.1/lodash.js#L1577 "View in source") [&#x24C9;][1]
9792
9793 ({string}): Used to reference the data object in the template text.
9794
9795 * * *
9796
9797 <!-- /div -->
9798
9799 <!-- /div -->
9800
9801 <!-- /div -->
9802
9803  [1]: #array "Jump back to the TOC."