Skip to content

Latest commit

 

History

History
33 lines (21 loc) · 513 Bytes

dropRight.md

File metadata and controls

33 lines (21 loc) · 513 Bytes

arrays.dropRight

dropRight(array, [count=1])

Remove N items from the end of the input array

Arguments

  1. array (Array): input array
  2. [count=1] (number): number of items to drop

Returns

(Array): input array sans the dropped items

Example

const result = arrays.drop([1, 2, 3], 2);
console.log(result);
> [1]