Skip to content

Commit

Permalink
[FIX] avoid arg reassignment when mentioning arguments in fcn body.
Browse files Browse the repository at this point in the history
  • Loading branch information
kgryte committed May 2, 2015
1 parent 16f8a57 commit 25e32f2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@ var MAXLENGTH = Math.pow( 2, 32 ) - 1;
* @param {Number} [increment] - increment
* @returns {Array} linearly spaced numeric array
*/
function incrspace( x1, x2, inc ) {
function incrspace( x1, x2, increment ) {
var arr,
len,
inc,
i;
if ( !isNumber( x1 ) ) {
throw new TypeError( 'incrspace()::invalid input argument. Start must be numeric. Value: `' + x1 + '`.' );
Expand All @@ -34,6 +35,7 @@ function incrspace( x1, x2, inc ) {
if ( arguments.length < 3 ) {
inc = 1;
} else {
inc = increment;
if ( !isNumber( inc ) ) {
throw new TypeError( 'incrspace()::invalid input argument. Increment must be numeric. Value: `' + inc + '`.' );
}
Expand Down

0 comments on commit 25e32f2

Please sign in to comment.