Const
Produces up to the specified number of elements from the beginning of the source iterable.
Curried version of _take.
Element type produced by the source iterable.
Maximum number of elements to yield; non-positive values return an empty iterable.
A deferred iterable yielding at most numItems elements from src.
numItems
src
const firstTwo = [..._take([1, 2, 3, 4], 2)];console.log(firstTwo); // [1, 2] Copy
const firstTwo = [..._take([1, 2, 3, 4], 2)];console.log(firstTwo); // [1, 2]
or using the curried version:
const firstTwo = [ ...pipeInto( [1, 2, 3, 4], take(2) ),];console.log(firstTwo); // [1, 2] Copy
const firstTwo = [ ...pipeInto( [1, 2, 3, 4], take(2) ),];console.log(firstTwo); // [1, 2]
Produces up to the specified number of elements from the beginning of the source iterable.
Curried version of _take.