UNPKG

bbo

Version:

bbo is a utility library of zero dependencies for javascript.

12 lines (9 loc) 259 B
'use strict'; /** * Returns a new array with n elements removed from the right. */ var dropRight = function (arr) { var n = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1; return arr.slice(0, -n); }; module.exports = dropRight;