SyntaxFix
Write A Post
Hire A Developer
Questions
With Lodash you can use dropRight, if you don't care to know which elements were removed:
_.dropRight([1, 2, 3]) // => [1, 2] _.dropRight([1, 2, 3], 2); // => [1]