Javascript Number timesPlusOne()

Description

Javascript Number timesPlusOne()


/**//from  w w w  .  j a va  2s.c  om
 * @example
 * (6).times() => [1,2,3,4,5,6]
 *
 * @returns {Array}
 */
Number.prototype.timesPlusOne = function () {
    return _.map(this.times(), function (i) {
        return i + 1;
    });
};



PreviousNext

Related