Skip to content

Commit 7b2217b

Browse files
committed
replace new Array() with literal
1 parent ae72f8e commit 7b2217b

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

  • lib/node_modules/@stdlib/utils/async/function-sequence/lib

lib/node_modules/@stdlib/utils/async/function-sequence/lib/main.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,9 @@ function funseqAsync() {
7676
if ( nFuncs < 2 ) {
7777
throw new Error( 'insufficient arguments. Must provide multiple functions to execute sequentially.' );
7878
}
79-
f = new Array( nFuncs );
79+
f = [];
8080
for ( i = 0; i < nFuncs; i++ ) {
81-
f[ i ] = arguments[ i ];
81+
f.push( arguments[ i ] );
8282
if ( !isFunction( f[ i ] ) ) {
8383
throw new TypeError( format( 'invalid argument. All arguments must be functions. Value: `%s`.', f[ i ] ) );
8484
}
@@ -101,9 +101,9 @@ function funseqAsync() {
101101
done = arguments[ arguments.length-1 ];
102102

103103
// Copy arguments which should be provided to the first invoked function...
104-
args = new Array( arguments.length-1 );
105-
for ( i = 0; i < args.length; i++ ) {
106-
args[ i ] = arguments[ i ];
104+
args = [];
105+
for ( i = 0; i < arguments.length - 1; i++ ) {
106+
args.push( arguments[ i ] );
107107
}
108108
// Append the callback an invoked function should call upon completion:
109109
args.push( next );

0 commit comments

Comments
 (0)