UNPKG

lenye_base

Version:

基础方法

12 lines (9 loc) 261 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;