Module

x/lodash_es/src/array.js>take

lodash for deno use
Latest
function take
import { take } from "https://dotland.deno.dev/x/lodash_es@v0.0.2/src/array.js";

Creates a slice of array with n elements taken from the beginning.

Examples

_.take([1, 2, 3]); // => [1]

_.take([1, 2, 3], 2); // => [1, 2]

_.take([1, 2, 3], 5); // => [1, 2, 3]

_.take([1, 2, 3], 0); // => []

Parameters

array

The array to query.

n
guard