es-toolkit
Version:
A state-of-the-art, high-performance JavaScript utility library with a small bundle size and strong type annotations.
13 lines (8 loc) • 314 B
JavaScript
;
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const toInteger = require('../compat/util/toInteger.js');
function take(arr, count, guard) {
count = guard || count === undefined ? 1 : toInteger.toInteger(count);
return arr.slice(0, count);
}
exports.take = take;