s9s-objects
Version:
Global object container, used across projects
44 lines (36 loc) • 796 B
JavaScript
;
exports = module.exports = Arguments;
const AbstractArray = require(__dirname + '/../AbstractArray');
/**
* Arguments class
*
* @constructor
* @extends {AbstractArray}
*/
function Arguments() {
AbstractArray.apply(this, arguments);
}
/**
* @type {AbstractArray}
*/
Arguments.prototype = new AbstractArray();
/**
* @type {Arguments}
*/
Arguments.prototype.constructor = Arguments;
/**
* @param {Array|Arguments|*} args
* @returns {Arguments}
*/
Arguments.fromArgumentsObject = function (args) {
var instance = new Arguments();
Arguments.apply(instance, args);
return instance;
};
/**
* Returns all elements, starting from second element
* @returns {Array}
*/
Arguments.prototype.fromSecondOn = function () {
return this.copy().splice(1);
};