diff --git a/lib/node_modules/@stdlib/utils/async/function-sequence/lib/main.js b/lib/node_modules/@stdlib/utils/async/function-sequence/lib/main.js index 28704adc2248..40d4489f6783 100644 --- a/lib/node_modules/@stdlib/utils/async/function-sequence/lib/main.js +++ b/lib/node_modules/@stdlib/utils/async/function-sequence/lib/main.js @@ -76,9 +76,9 @@ function funseqAsync() { if ( nFuncs < 2 ) { throw new Error( 'insufficient arguments. Must provide multiple functions to execute sequentially.' ); } - f = new Array( nFuncs ); + f = []; for ( i = 0; i < nFuncs; i++ ) { - f[ i ] = arguments[ i ]; + f.push( arguments[ i ] ); if ( !isFunction( f[ i ] ) ) { throw new TypeError( format( 'invalid argument. All arguments must be functions. Value: `%s`.', f[ i ] ) ); } @@ -101,9 +101,9 @@ function funseqAsync() { done = arguments[ arguments.length-1 ]; // Copy arguments which should be provided to the first invoked function... - args = new Array( arguments.length-1 ); - for ( i = 0; i < args.length; i++ ) { - args[ i ] = arguments[ i ]; + args = []; + for ( i = 0; i < arguments.length - 1; i++ ) { + args.push( arguments[ i ] ); } // Append the callback an invoked function should call upon completion: args.push( next );