From b968a0f5f7af934452afa7edc695aefa812ab0ce Mon Sep 17 00:00:00 2001 From: Narutama Aurum Date: Mon, 1 Jun 2026 09:19:32 +0800 Subject: [PATCH 1/2] chore: fix JavaScript lint errors (issue #12411) Replace new Array() constructor with array literal and push as required by stdlib/no-new-array lint rule. Resolves #12411 --- lib/node_modules/@stdlib/stats/ztest2/examples/index.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/node_modules/@stdlib/stats/ztest2/examples/index.js b/lib/node_modules/@stdlib/stats/ztest2/examples/index.js index d49169f4fff5..1fe6f2864496 100644 --- a/lib/node_modules/@stdlib/stats/ztest2/examples/index.js +++ b/lib/node_modules/@stdlib/stats/ztest2/examples/index.js @@ -28,14 +28,14 @@ var y; var i; // Values drawn from a Normal(4,2) distribution -x = new Array( 100 ); +x = []; for ( i = 0; i < 100; i++ ) { - x[ i ] = rnorm( 4.0, 2.0 ); + x.push( rnorm( 4.0, 2.0 ) ); } // Values drawn from a Normal(3,2) distribution -y = new Array( 80 ); +y = []; for ( i = 0; i < 80; i++ ) { - y[ i ] = rnorm( 3.0, 2.0 ); + y.push( rnorm( 3.0, 2.0 ) ); } out = ztest2( x, y, 2.0, 2.0 ); From cc9fa515870f5bbbf2694a1c1dc9e64c604b35f6 Mon Sep 17 00:00:00 2001 From: Athan Date: Sun, 5 Jul 2026 22:55:09 -0700 Subject: [PATCH 2/2] docs: remove explicit loops Signed-off-by: Athan --- .../@stdlib/stats/ztest2/examples/index.js | 23 +++++-------------- 1 file changed, 6 insertions(+), 17 deletions(-) diff --git a/lib/node_modules/@stdlib/stats/ztest2/examples/index.js b/lib/node_modules/@stdlib/stats/ztest2/examples/index.js index 1fe6f2864496..7d14c40fd7ba 100644 --- a/lib/node_modules/@stdlib/stats/ztest2/examples/index.js +++ b/lib/node_modules/@stdlib/stats/ztest2/examples/index.js @@ -18,28 +18,17 @@ 'use strict'; -var rnorm = require( '@stdlib/random/base/normal' ); +var normal = require( '@stdlib/random/array/normal' ); var ztest2 = require( './../lib' ); -var table; -var out; -var x; -var y; -var i; - // Values drawn from a Normal(4,2) distribution -x = []; -for ( i = 0; i < 100; i++ ) { - x.push( rnorm( 4.0, 2.0 ) ); -} +var x = normal( 100, 4.0, 2.0 ); + // Values drawn from a Normal(3,2) distribution -y = []; -for ( i = 0; i < 80; i++ ) { - y.push( rnorm( 3.0, 2.0 ) ); -} +var y = normal( 80, 3.0, 2.0 ); -out = ztest2( x, y, 2.0, 2.0 ); -table = out.print(); +var out = ztest2( x, y, 2.0, 2.0 ); +var table = out.print(); console.log( table ); out = ztest2( x, y, 2.0, 2.0, {