Skip to content

Commit d4496fc

Browse files
committed
chore: address commit comments for commit 8b01d81
1 parent 9687965 commit d4496fc

File tree

1 file changed

+6
-2
lines changed
  • lib/node_modules/@stdlib/utils/tabulate-by/examples

1 file changed

+6
-2
lines changed

lib/node_modules/@stdlib/utils/tabulate-by/examples/index.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
'use strict';
2020

21+
2122
var discreteUniform = require( '@stdlib/random/array/discrete-uniform' );
2223
var take = require( '@stdlib/array/take' );
2324
var tabulateBy = require( './../lib' );
@@ -32,8 +33,11 @@ function indicator( value ) {
3233

3334
vals = [ 'beep', 'boop', 'foo', 'bar', 'woot', 'woot' ];
3435

35-
// Generate a random collection...
36-
arr = take( vals, discreteUniform( 100, 0, vals.length - 1 ) );
36+
// Generate random indices:
37+
var idx = discreteUniform( 100, 0, vals.length-1 );
38+
39+
// Select values:
40+
arr = take( vals, idx );
3741

3842
// Generate a frequency table:
3943
out = tabulateBy( arr, indicator );

0 commit comments

Comments
 (0)