Skip to content

Commit 2e3ed73

Browse files
authored
docs: apply suggestions from code review
Signed-off-by: Muhammad Haris <[email protected]>
1 parent c1eefaf commit 2e3ed73

File tree

1 file changed

+6
-10
lines changed
  • lib/node_modules/@stdlib/blas/ext/base/ndarray/gfind-index

1 file changed

+6
-10
lines changed

lib/node_modules/@stdlib/blas/ext/base/ndarray/gfind-index/README.md

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -61,18 +61,14 @@ If the function is unable to find a search element, the function returns `-1`.
6161
var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' );
6262
var ndarray = require( '@stdlib/ndarray/base/ctor' );
6363

64-
var xbuf = [ 1.0, 3.0, 4.0, 2.0 ];
65-
var x = new ndarray( 'generic', xbuf, [ 4 ], [ 1 ], 0, 'row-major' );
66-
67-
var searchElement = scalar2ndarray( 10.0, {
68-
'dtype': 'generic'
69-
});
64+
function isEven( v ) {
65+
return v % 2.0 === 0.0;
66+
}
7067

71-
var fromIndex = scalar2ndarray( 0, {
72-
'dtype': 'generic'
73-
});
68+
var xbuf = [ 1.0, 3.0, 5.0, 7.0 ];
69+
var x = new ndarray( 'generic', xbuf, [ 4 ], [ 1 ], 0, 'row-major' );
7470

75-
var idx = gfindIndex( [ x, searchElement, fromIndex ] );
71+
var idx = gfindIndex( [ x ], isEven );
7672
// returns -1
7773
```
7874

0 commit comments

Comments
 (0)