UNPKG

es-toolkit

Version:

A state-of-the-art, high-performance JavaScript utility library with a small bundle size and strong type annotations.

14 lines (10 loc) 303 B
'use strict'; Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); function dropRight(arr, itemsCount) { itemsCount = Math.min(-itemsCount, 0); if (itemsCount === 0) { return arr.slice(); } return arr.slice(0, itemsCount); } exports.dropRight = dropRight;