@@ -76,11 +76,11 @@ tape( 'the function calculates the maximum value of a strided array via a callba
7676 v = nanmaxBy ( x . length , x , 1 , accessor ) ;
7777 t . strictEqual ( isnan ( v ) , true , 'returns expected value' ) ;
7878
79- x = new Array ( 5 ) ; // sparse array
79+ x = Array ( 5 ) . fill ( undefined ) ; // sparse array
8080 v = nanmaxBy ( x . length , x , 1 , accessor ) ;
8181 t . strictEqual ( isnan ( v ) , true , 'returns expected value' ) ;
8282
83- x = new Array ( 5 ) ; // sparse array
83+ x = Array ( 5 ) . fill ( undefined ) ; // sparse array
8484 x [ 2 ] = 1.0 ;
8585 v = nanmaxBy ( x . length , x , 1 , accessor ) ;
8686 t . strictEqual ( v , 2.0 , 'returns expected value' ) ;
@@ -112,11 +112,11 @@ tape( 'the function calculates the maximum value of a strided array via a callba
112112 v = nanmaxBy ( x . length , toAccessorArray ( x ) , 1 , accessor ) ;
113113 t . strictEqual ( isnan ( v ) , true , 'returns expected value' ) ;
114114
115- x = new Array ( 5 ) ; // sparse array
115+ x = Array ( 5 ) . fill ( undefined ) ; // sparse array
116116 v = nanmaxBy ( x . length , toAccessorArray ( x ) , 1 , accessor ) ;
117117 t . strictEqual ( isnan ( v ) , true , 'returns expected value' ) ;
118118
119- x = new Array ( 5 ) ; // sparse array
119+ x = Array ( 5 ) . fill ( undefined ) ; // sparse array
120120 x [ 2 ] = 1.0 ;
121121 v = nanmaxBy ( x . length , toAccessorArray ( x ) , 1 , accessor ) ;
122122 t . strictEqual ( v , 2.0 , 'returns expected value' ) ;
@@ -163,7 +163,7 @@ tape( 'if provided an `N` parameter equal to `1`, the function returns the first
163163 v = nanmaxBy ( 1 , x , 1 , accessor ) ;
164164 t . strictEqual ( v , 2.0 , 'returns expected value' ) ;
165165
166- x = new Array ( 1 ) ; // sparse array
166+ x = Array ( 5 ) . fill ( undefined ) ; // sparse array
167167 v = nanmaxBy ( 1 , x , 1 , accessor ) ;
168168 t . strictEqual ( isnan ( v ) , true , 'returns expected value' ) ;
169169
@@ -179,7 +179,7 @@ tape( 'if provided an `N` parameter equal to `1`, the function returns the first
179179 v = nanmaxBy ( 1 , toAccessorArray ( x ) , 1 , accessor ) ;
180180 t . strictEqual ( v , 2.0 , 'returns expected value' ) ;
181181
182- x = new Array ( 1 ) ; // sparse array
182+ x = Array ( 1 ) . fill ( undefined ) ; // sparse array
183183 v = nanmaxBy ( 1 , toAccessorArray ( x ) , 1 , accessor ) ;
184184 t . strictEqual ( isnan ( v ) , true , 'returns expected value' ) ;
185185
@@ -295,7 +295,7 @@ tape( 'if provided a `stride` parameter equal to `0`, the function returns the f
295295 v = nanmaxBy ( x . length , x , 0 , accessor ) ;
296296 t . strictEqual ( v , 2.0 , 'returns expected value' ) ;
297297
298- x = new Array ( 1 ) ; // sparse array
298+ x = Array ( ) . fill ( undefined ) ; // sparse array
299299 v = nanmaxBy ( 1 , x , 0 , accessor ) ;
300300 t . strictEqual ( isnan ( v ) , true , 'returns expected value' ) ;
301301
@@ -311,7 +311,7 @@ tape( 'if provided a `stride` parameter equal to `0`, the function returns the f
311311 v = nanmaxBy ( x . length , x , 0 , accessor ) ;
312312 t . strictEqual ( v , 2.0 , 'returns expected value' ) ;
313313
314- x = new Array ( 1 ) ; // sparse array
314+ x = Array ( 1 ) . fill ( undefined ) ; // sparse array
315315 v = nanmaxBy ( 1 , toAccessorArray ( x ) , 0 , accessor ) ;
316316 t . strictEqual ( isnan ( v ) , true , 'returns expected value' ) ;
317317
0 commit comments