Ohm-Management - Projektarbeit B-ME
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

index.js 565B

123456789101112131415161718192021222324252627282930313233
  1. /**
  2. * An Array.prototype.slice.call(arguments) alternative
  3. *
  4. * @param {Object} args something with a length
  5. * @param {Number} slice
  6. * @param {Number} sliceEnd
  7. * @api public
  8. */
  9. module.exports = function (args, slice, sliceEnd) {
  10. var ret = [];
  11. var len = args.length;
  12. if (0 === len) return ret;
  13. var start = slice < 0
  14. ? Math.max(0, slice + len)
  15. : slice || 0;
  16. if (sliceEnd !== undefined) {
  17. len = sliceEnd < 0
  18. ? sliceEnd + len
  19. : sliceEnd
  20. }
  21. while (len-- > start) {
  22. ret[len - start] = args[len];
  23. }
  24. return ret;
  25. }