Lines Matching refs:array

417 <h3 id="_chunkarray-size1"><code>_.chunk(array, [size=1])</code></h3>
420 Creates an array of elements split into groups the length of `size`.
421 If `array` can't be split evenly, the final chunk will be the remaining
428 1. `array` *(Array)*: The array to process.
432 *(Array)*: Returns the new array of chunks.
448 <h3 id="_compactarray"><code>_.compact(array)</code></h3>
451 Creates an array with all falsey values removed. The values `false`, `null`,
458 1. `array` *(Array)*: The array to compact.
461 *(Array)*: Returns the new array of filtered values.
474 <h3 id="_concatarray-values"><code>_.concat(array, [values])</code></h3>
477 Creates a new array concatenating `array` with any additional arrays
484 1. `array` *(Array)*: The array to concatenate.
488 *(Array)*: Returns the new concatenated array.
492 var array = [1];
493 var other = _.concat(array, 2, [3], [[4]]);
498 console.log(array);
507 <h3 id="_differencearray-values"><code>_.difference(array, [values])</code></h3>
510 Creates an array of `array` values not included in the other given arrays
513 determined by the first array.
516 **Note:** Unlike `_.pullAll`, this method returns a new array.
522 1. `array` *(Array)*: The array to inspect.
526 *(Array)*: Returns the new array of filtered values.
539 <h3 id="_differencebyarray-values-iteratee_identity"><code>_.differenceBy(array, [values], [iterate…
543 is invoked for each element of `array` and `values` to generate the criterion
545 determined by the first array. The iteratee is invoked with one argument:<br>
549 **Note:** Unlike `_.pullAllBy`, this method returns a new array.
555 1. `array` *(Array)*: The array to inspect.
560 *(Array)*: Returns the new array of filtered values.
577 <h3 id="_differencewitharray-values-comparator"><code>_.differenceWith(array, [values], [comparator…
581 which is invoked to compare elements of `array` to `values`. The order and
582 references of result values are determined by the first array. The comparator
586 **Note:** Unlike `_.pullAllWith`, this method returns a new array.
592 1. `array` *(Array)*: The array to inspect.
597 *(Array)*: Returns the new array of filtered values.
612 <h3 id="_droparray-n1"><code>_.drop(array, [n=1])</code></h3>
615 Creates a slice of `array` with `n` elements dropped from the beginning.
621 1. `array` *(Array)*: The array to query.
625 *(Array)*: Returns the slice of `array`.
647 <h3 id="_droprightarray-n1"><code>_.dropRight(array, [n=1])</code></h3>
650 Creates a slice of `array` with `n` elements dropped from the end.
656 1. `array` *(Array)*: The array to query.
660 *(Array)*: Returns the slice of `array`.
682 <h3 id="_droprightwhilearray-predicate_identity"><code>_.dropRightWhile(array, [predicate=_.identit…
685 Creates a slice of `array` excluding elements dropped from the end.
687 invoked with three arguments: *(value, index, array)*.
693 1. `array` *(Array)*: The array to query.
697 *(Array)*: Returns the slice of `array`.
728 <h3 id="_dropwhilearray-predicate_identity"><code>_.dropWhile(array, [predicate=_.identity])</code>…
731 Creates a slice of `array` excluding elements dropped from the beginning.
733 invoked with three arguments: *(value, index, array)*.
739 1. `array` *(Array)*: The array to query.
743 *(Array)*: Returns the slice of `array`.
774 <h3 id="_fillarray-value-start0-endarraylength"><code>_.fill(array, value, [start=0], [end=array.le…
777 Fills elements of `array` with `value` from `start` up to, but not
781 **Note:** This method mutates `array`.
787 1. `array` *(Array)*: The array to fill.
788 2. `value` *(&#42;)*: The value to fill `array` with.
790 4. `[end=array.length]` *(number)*: The end position.
793 *(Array)*: Returns `array`.
797 var array = [1, 2, 3];
799 _.fill(array, 'a');
800 console.log(array);
815 <h3 id="_findindexarray-predicate_identity-fromindex0"><code>_.findIndex(array, [predicate=_.identi…
825 1. `array` *(Array)*: The array to inspect.
861 …entity-fromindexarraylength-1"><code>_.findLastIndex(array, [predicate=_.identity], [fromIndex=arr…
871 1. `array` *(Array)*: The array to inspect.
873 3. `[fromIndex=array.length-1]` *(number)*: The index to search from.
907 <h3 id="_flattenarray"><code>_.flatten(array)</code></h3>
910 Flattens `array` a single level deep.
916 1. `array` *(Array)*: The array to flatten.
919 *(Array)*: Returns the new flattened array.
932 <h3 id="_flattendeeparray"><code>_.flattenDeep(array)</code></h3>
935 Recursively flattens `array`.
941 1. `array` *(Array)*: The array to flatten.
944 *(Array)*: Returns the new flattened array.
957 <h3 id="_flattendeptharray-depth1"><code>_.flattenDepth(array, [depth=1])</code></h3>
960 Recursively flatten `array` up to `depth` times.
966 1. `array` *(Array)*: The array to flatten.
970 *(Array)*: Returns the new flattened array.
974 var array = [1, [2, [3, [4]], 5]];
976 _.flattenDepth(array, 1);
979 _.flattenDepth(array, 2);
1014 <h3 id="_headarray"><code>_.head(array)</code></h3>
1017 Gets the first element of `array`.
1026 1. `array` *(Array)*: The array to query.
1029 *(&#42;)*: Returns the first element of `array`.
1045 <h3 id="_indexofarray-value-fromindex0"><code>_.indexOf(array, value, [fromIndex=0])</code></h3>
1048 Gets the index at which the first occurrence of `value` is found in `array`
1051 offset from the end of `array`.
1057 1. `array` *(Array)*: The array to inspect.
1079 <h3 id="_initialarray"><code>_.initial(array)</code></h3>
1082 Gets all but the last element of `array`.
1088 1. `array` *(Array)*: The array to query.
1091 *(Array)*: Returns the slice of `array`.
1107 Creates an array of unique values that are included in all given arrays
1110 determined by the first array.
1119 *(Array)*: Returns the new array of intersecting values.
1138 determined by the first array. The iteratee is invoked with one argument:<br>
1149 *(Array)*: Returns the new array of intersecting values.
1171 of result values are determined by the first array. The comparator is
1182 *(Array)*: Returns the new array of intersecting values.
1198 <h3 id="_joinarray-separator-"><code>_.join(array, [separator=','])</code></h3>
1201 Converts all elements in `array` into a string separated by `separator`.
1207 1. `array` *(Array)*: The array to convert.
1224 <h3 id="_lastarray"><code>_.last(array)</code></h3>
1227 Gets the last element of `array`.
1233 1. `array` *(Array)*: The array to query.
1236 *(&#42;)*: Returns the last element of `array`.
1249 …dexofarray-value-fromindexarraylength-1"><code>_.lastIndexOf(array, value, [fromIndex=array.length…
1253 `array` from right to left.
1259 1. `array` *(Array)*: The array to inspect.
1261 3. `[fromIndex=array.length-1]` *(number)*: The index to search from.
1281 <h3 id="_ntharray-n0"><code>_.nth(array, [n=0])</code></h3>
1284 Gets the element at index `n` of `array`. If `n` is negative, the nth
1291 1. `array` *(Array)*: The array to query.
1295 *(&#42;)*: Returns the nth element of `array`.
1299 var array = ['a', 'b', 'c', 'd'];
1301 _.nth(array, 1);
1304 _.nth(array, -2);
1313 <h3 id="_pullarray-values"><code>_.pull(array, [values])</code></h3>
1316 Removes all given values from `array` using
1321 **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove`
1322 to remove elements from an array by predicate.
1328 1. `array` *(Array)*: The array to modify.
1332 *(Array)*: Returns `array`.
1336 var array = ['a', 'b', 'c', 'a', 'b', 'c'];
1338 _.pull(array, 'a', 'c');
1339 console.log(array);
1348 <h3 id="_pullallarray-values"><code>_.pullAll(array, values)</code></h3>
1351 This method is like `_.pull` except that it accepts an array of values to remove.
1354 **Note:** Unlike `_.difference`, this method mutates `array`.
1360 1. `array` *(Array)*: The array to modify.
1364 *(Array)*: Returns `array`.
1368 var array = ['a', 'b', 'c', 'a', 'b', 'c'];
1370 _.pullAll(array, ['a', 'c']);
1371 console.log(array);
1380 <h3 id="_pullallbyarray-values-iteratee_identity"><code>_.pullAllBy(array, values, [iteratee=_.iden…
1384 invoked for each element of `array` and `values` to generate the criterion
1388 **Note:** Unlike `_.differenceBy`, this method mutates `array`.
1394 1. `array` *(Array)*: The array to modify.
1399 *(Array)*: Returns `array`.
1403 var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];
1405 _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x');
1406 console.log(array);
1415 <h3 id="_pullallwitharray-values-comparator"><code>_.pullAllWith(array, values, [comparator])</code…
1419 is invoked to compare elements of `array` to `values`. The comparator is
1423 **Note:** Unlike `_.differenceWith`, this method mutates `array`.
1429 1. `array` *(Array)*: The array to modify.
1434 *(Array)*: Returns `array`.
1438 var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }];
1440 _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual);
1441 console.log(array);
1450 <h3 id="_pullatarray-indexes"><code>_.pullAt(array, [indexes])</code></h3>
1453 Removes elements from `array` corresponding to `indexes` and returns an
1454 array of removed elements.
1457 **Note:** Unlike `_.at`, this method mutates `array`.
1463 1. `array` *(Array)*: The array to modify.
1467 *(Array)*: Returns the new array of removed elements.
1471 var array = ['a', 'b', 'c', 'd'];
1472 var pulled = _.pullAt(array, [1, 3]);
1474 console.log(array);
1486 <h3 id="_removearray-predicate_identity"><code>_.remove(array, [predicate=_.identity])</code></h3>
1489 Removes all elements from `array` that `predicate` returns truthy for
1490 and returns an array of the removed elements. The predicate is invoked
1491 with three arguments: *(value, index, array)*.
1494 **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull`
1495 to pull elements from an array by value.
1501 1. `array` *(Array)*: The array to modify.
1505 *(Array)*: Returns the new array of removed elements.
1509 var array = [1, 2, 3, 4];
1510 var evens = _.remove(array, function(n) {
1514 console.log(array);
1526 <h3 id="_reversearray"><code>_.reverse(array)</code></h3>
1529 Reverses `array` so that the first element becomes the last, the second
1533 **Note:** This method mutates `array` and is based on
1540 1. `array` *(Array)*: The array to modify.
1543 *(Array)*: Returns `array`.
1547 var array = [1, 2, 3];
1549 _.reverse(array);
1552 console.log(array);
1561 <h3 id="_slicearray-start0-endarraylength"><code>_.slice(array, [start=0], [end=array.length])</cod…
1564 Creates a slice of `array` from `start` up to, but not including, `end`.
1575 1. `array` *(Array)*: The array to slice.
1577 3. `[end=array.length]` *(number)*: The end position.
1580 *(Array)*: Returns the slice of `array`.
1588 <h3 id="_sortedindexarray-value"><code>_.sortedIndex(array, value)</code></h3>
1592 should be inserted into `array` in order to maintain its sort order.
1598 1. `array` *(Array)*: The sorted array to inspect.
1602 *(number)*: Returns the index at which `value` should be inserted into `array`.
1615 <h3 id="_sortedindexbyarray-value-iteratee_identity"><code>_.sortedIndexBy(array, value, [iteratee=…
1619 which is invoked for `value` and each element of `array` to compute their
1626 1. `array` *(Array)*: The sorted array to inspect.
1631 *(number)*: Returns the index at which `value` should be inserted into `array`.
1650 <h3 id="_sortedindexofarray-value"><code>_.sortedIndexOf(array, value)</code></h3>
1654 search on a sorted `array`.
1660 1. `array` *(Array)*: The array to inspect.
1677 <h3 id="_sortedlastindexarray-value"><code>_.sortedLastIndex(array, value)</code></h3>
1681 index at which `value` should be inserted into `array` in order to
1688 1. `array` *(Array)*: The sorted array to inspect.
1692 *(number)*: Returns the index at which `value` should be inserted into `array`.
1705 <h3 id="_sortedlastindexbyarray-value-iteratee_identity"><code>_.sortedLastIndexBy(array, value, [i…
1709 which is invoked for `value` and each element of `array` to compute their
1716 1. `array` *(Array)*: The sorted array to inspect.
1721 *(number)*: Returns the index at which `value` should be inserted into `array`.
1740 <h3 id="_sortedlastindexofarray-value"><code>_.sortedLastIndexOf(array, value)</code></h3>
1744 search on a sorted `array`.
1750 1. `array` *(Array)*: The array to inspect.
1767 <h3 id="_sorteduniqarray"><code>_.sortedUniq(array)</code></h3>
1777 1. `array` *(Array)*: The array to inspect.
1780 *(Array)*: Returns the new duplicate free array.
1793 <h3 id="_sorteduniqbyarray-iteratee"><code>_.sortedUniqBy(array, [iteratee])</code></h3>
1803 1. `array` *(Array)*: The array to inspect.
1807 *(Array)*: Returns the new duplicate free array.
1820 <h3 id="_tailarray"><code>_.tail(array)</code></h3>
1823 Gets all but the first element of `array`.
1829 1. `array` *(Array)*: The array to query.
1832 *(Array)*: Returns the slice of `array`.
1845 <h3 id="_takearray-n1"><code>_.take(array, [n=1])</code></h3>
1848 Creates a slice of `array` with `n` elements taken from the beginning.
1854 1. `array` *(Array)*: The array to query.
1858 *(Array)*: Returns the slice of `array`.
1880 <h3 id="_takerightarray-n1"><code>_.takeRight(array, [n=1])</code></h3>
1883 Creates a slice of `array` with `n` elements taken from the end.
1889 1. `array` *(Array)*: The array to query.
1893 *(Array)*: Returns the slice of `array`.
1915 <h3 id="_takerightwhilearray-predicate_identity"><code>_.takeRightWhile(array, [predicate=_.identit…
1918 Creates a slice of `array` with elements taken from the end. Elements are
1920 three arguments: *(value, index, array)*.
1926 1. `array` *(Array)*: The array to query.
1930 *(Array)*: Returns the slice of `array`.
1961 <h3 id="_takewhilearray-predicate_identity"><code>_.takeWhile(array, [predicate=_.identity])</code>…
1964 Creates a slice of `array` with elements taken from the beginning. Elements
1966 three arguments: *(value, index, array)*.
1972 1. `array` *(Array)*: The array to query.
1976 *(Array)*: Returns the slice of `array`.
2010 Creates an array of unique values, in order, from all given arrays using
2021 *(Array)*: Returns the new array of combined values.
2040 array in which the value occurs. The iteratee is invoked with one argument:<br>
2051 *(Array)*: Returns the new array of combined values.
2073 the first array in which the value occurs. The comparator is invoked
2084 *(Array)*: Returns the new array of combined values.
2100 <h3 id="_uniqarray"><code>_.uniq(array)</code></h3>
2103 Creates a duplicate-free version of an array, using
2107 in the array.
2113 1. `array` *(Array)*: The array to inspect.
2116 *(Array)*: Returns the new duplicate free array.
2129 <h3 id="_uniqbyarray-iteratee_identity"><code>_.uniqBy(array, [iteratee=_.identity])</code></h3>
2133 invoked for each element in `array` to generate the criterion by which
2135 order they occur in the array. The iteratee is invoked with one argument:<br>
2142 1. `array` *(Array)*: The array to inspect.
2146 *(Array)*: Returns the new duplicate free array.
2163 <h3 id="_uniqwitharray-comparator"><code>_.uniqWith(array, [comparator])</code></h3>
2167 is invoked to compare elements of `array`. The order of result values is
2168 determined by the order they occur in the array.The comparator is invoked
2175 1. `array` *(Array)*: The array to inspect.
2179 *(Array)*: Returns the new duplicate free array.
2194 <h3 id="_unziparray"><code>_.unzip(array)</code></h3>
2197 This method is like `_.zip` except that it accepts an array of grouped
2198 elements and creates an array regrouping the elements to their pre-zip
2205 1. `array` *(Array)*: The array of grouped elements to process.
2208 *(Array)*: Returns the new array of regrouped elements.
2224 <h3 id="_unzipwitharray-iteratee_identity"><code>_.unzipWith(array, [iteratee=_.identity])</code></…
2235 1. `array` *(Array)*: The array of grouped elements to process.
2239 *(Array)*: Returns the new array of regrouped elements.
2255 <h3 id="_withoutarray-values"><code>_.without(array, [values])</code></h3>
2258 Creates an array excluding all given values using
2263 **Note:** Unlike `_.pull`, this method returns a new array.
2269 1. `array` *(Array)*: The array to inspect.
2273 *(Array)*: Returns the new array of filtered values.
2289 Creates an array of unique values that is the
2301 *(Array)*: Returns the new array of filtered values.
2331 *(Array)*: Returns the new array of filtered values.
2364 *(Array)*: Returns the new array of filtered values.
2383 Creates an array of grouped elements, the first of which contains the
2394 *(Array)*: Returns the new array of grouped elements.
2475 *(Array)*: Returns the new array of grouped elements.
2583 Iterates over elements of `collection`, returning an array of all elements
2588 **Note:** Unlike `_.remove`, this method returns a new array.
2598 *(Array)*: Returns the new filtered array.
2708 Creates a flattened array of values by running each element in `collection`
2720 *(Array)*: Returns the new flattened array.
2751 *(Array)*: Returns the new flattened array.
2783 *(Array)*: Returns the new flattened array.
2881 value of each key is an array of elements responsible for generating the
2953 an array of the results of each invoked method. Any additional arguments
2966 *(Array)*: Returns the array of results.
3002 var array = [
3007 _.keyBy(array, function(o) {
3012 _.keyBy(array, 'dir');
3024 Creates an array of values by running each element in `collection` thru
3047 *(Array)*: Returns the new mapped array.
3093 *(Array)*: Returns the new sorted array.
3117 Creates an array of elements split into two groups, the first of which
3130 *(Array)*: Returns the array of grouped elements.
3229 var array = [[0, 1], [2, 3], [4, 5]];
3231 _.reduceRight(array, function(flattened, other) {
3256 *(Array)*: Returns the new filtered array.
3344 Creates an array of shuffled values, using a version of the
3354 *(Array)*: Returns the new shuffled array.
3370 Gets the size of `collection` by returning its length for array-like
3447 Creates an array of elements, sorted in ascending order by the results of
3460 *(Array)*: Returns the new sorted array.
4258 an array.
4294 create function and an array of arguments much like
4460 Casts `value` as an array if it's not one.
4469 *(Array)*: Returns the cast array.
4491 var array = [1, 2, 3];
4492 console.log(_.castArray(array) === array);
4509 and supports cloning arrays, array buffers, booleans, date objects, maps,
4828 *(boolean)*: Returns `true` if `value` is an array, else `false`.
4862 *(boolean)*: Returns `true` if `value` is an array buffer, else `false`.
4881 Checks if `value` is array-like. A value is considered array-like if it's
4892 *(boolean)*: Returns `true` if `value` is array-like, else `false`.
4927 *(boolean)*: Returns `true` if `value` is an array-like object, else `false`.
5114 **Note:** This method supports comparing arrays, array buffers, booleans,
5178 var array = ['hello', 'goodbye'];
5181 _.isEqualWith(array, other, customizer);
5326 Checks if `value` is a valid array-like length.
5400 Partial comparisons will match empty array and empty object `source`
5401 values against any array or object value, respectively. See `_.isEqual`
5911 Checks if `value` is classified as a typed array.
5920 *(boolean)*: Returns `true` if `value` is a typed array, else `false`.
6087 Converts `value` to an array.
6096 *(Array)*: Returns the converted array.
6194 array-like object.
6487 <h3 id="_maxarray"><code>_.max(array)</code></h3>
6490 Computes the maximum value of `array`. If `array` is empty or falsey,
6497 1. `array` *(Array)*: The array to iterate over.
6516 <h3 id="_maxbyarray-iteratee_identity"><code>_.maxBy(array, [iteratee=_.identity])</code></h3>
6520 invoked for each element in `array` to generate the criterion by which
6527 1. `array` *(Array)*: The array to iterate over.
6550 <h3 id="_meanarray"><code>_.mean(array)</code></h3>
6553 Computes the mean of the values in `array`.
6559 1. `array` *(Array)*: The array to iterate over.
6575 <h3 id="_meanbyarray-iteratee_identity"><code>_.meanBy(array, [iteratee=_.identity])</code></h3>
6579 invoked for each element in `array` to generate the value to be averaged.
6586 1. `array` *(Array)*: The array to iterate over.
6609 <h3 id="_minarray"><code>_.min(array)</code></h3>
6612 Computes the minimum value of `array`. If `array` is empty or falsey,
6619 1. `array` *(Array)*: The array to iterate over.
6638 <h3 id="_minbyarray-iteratee_identity"><code>_.minBy(array, [iteratee=_.identity])</code></h3>
6642 invoked for each element in `array` to generate the criterion by which
6649 1. `array` *(Array)*: The array to iterate over.
6756 <h3 id="_sumarray"><code>_.sum(array)</code></h3>
6759 Computes the sum of the values in `array`.
6765 1. `array` *(Array)*: The array to iterate over.
6781 <h3 id="_sumbyarray-iteratee_identity"><code>_.sumBy(array, [iteratee=_.identity])</code></h3>
6785 invoked for each element in `array` to generate the value to be summed.
6792 1. `array` *(Array)*: The array to iterate over.
7119 Creates an array of values corresponding to `paths` of `object`.
7492 Creates an array of function property names from own enumerable properties
7525 Creates an array of function property names from own and inherited
7700 corresponding inverted value of each inverted key is an array of keys
7764 Creates an array of the own enumerable property names of `object`.
7778 *(Array)*: Returns the array of property names.
7804 Creates an array of the own and inherited enumerable property names of `object`.
7816 *(Array)*: Returns the array of property names.
8230 Creates an array of own enumerable string keyed-value pairs for `object`
8267 Creates an array of own and inherited enumerable string keyed-value pairs
8459 Creates an array of the own enumerable string keyed property values of `object`.
8471 *(Array)*: Returns the array of property values.
8497 Creates an array of the own and inherited enumerable string keyed property
8510 *(Array)*: Returns the array of property values.
8559 fusion if the section is applied to an array and iteratees accept only
8732 .tap(function(array) {
8733 // Mutate input array.
8734 array.pop();
8883 var array = [1, 2];
8884 var wrapped = _(array).push(3);
8886 console.log(array);
8890 console.log(array);
8896 console.log(array);
8977 **Note:** This method mutates the wrapped array.
8987 var array = [1, 2, 3];
8989 _(array).reverse().value()
8992 console.log(array);
10044 Splits `string` into an array of its words.
10379 property value for a given element. If `func` is an array or object, the
10439 Partial comparisons will match empty array and empty object `source`
10440 values against any array or object value, respectively. See `_.isEqual`
10476 **Note:** Partial comparisons will match empty array and empty object
10477 `srcValue` values against any array or object value, respectively. See
10560 var array = _.times(3, _.constant),
10561 object = { 'a': array, 'b': array, 'c': array };
10841 var array = [0, 1, 2],
10842 object = { 'a': array, 'b': array, 'c': array };
10859 Creates an array of numbers *(positive and/or negative)* progressing from
10997 This method returns a new empty array.
11003 *(Array)*: Returns the new empty array.
11117 Invokes the iteratee `n` times, returning an array of the results of
11128 *(Array)*: Returns the array of results.
11147 Converts `value` to a property path array.
11156 *(Array)*: Returns the new property path array.
11304 [1]: #array "Jump back to the TOC."