@@ -61,14 +61,14 @@ var table = {
61
61
* @name indexOf
62
62
* @type {Function }
63
63
* @param {ndarrayLike } x - input ndarray
64
- * @param {( ndarrayLike|number) } searchElement - search element
65
- * @param {( ndarrayLike|number) } [ fromIndex] - index from which to begin searching
64
+ * @param {ndarrayLike } searchElement - search element
65
+ * @param {ndarrayLike } fromIndex - indices from which to begin searching
66
66
* @param {Options } [options] - function options
67
67
* @param {IntegerArray } [options.dims] - list of dimensions over which to perform operation
68
68
* @param {string } [options.dtype] - output ndarray data type
69
69
* @throws {TypeError } first argument must be an ndarray-like object
70
- * @throws {TypeError } search element argument must be either an ndarray-like object or a scalar value
71
- * @throws {TypeError } from index argument must be either an ndarray-like object or a scalar value
70
+ * @throws {TypeError } second argument must be either an ndarray-like object
71
+ * @throws {TypeError } third argument must be either an ndarray-like object
72
72
* @throws {TypeError } options argument must be an object
73
73
* @throws {RangeError } dimension indices must not exceed input ndarray bounds
74
74
* @throws {RangeError } number of dimension indices must not exceed the number of input ndarray dimensions
@@ -77,6 +77,7 @@ var table = {
77
77
*
78
78
* @example
79
79
* var Float64Array = require( '@stdlib/array/float64' );
80
+ * var scalar2ndarray = require( '@stdlib/ndarray/from-scalar' );
80
81
* var ndarray = require( '@stdlib/ndarray/ctor' );
81
82
*
82
83
* // Create a data buffer:
@@ -94,8 +95,18 @@ var table = {
94
95
* // Create an input ndarray:
95
96
* var x = new ndarray( 'float64', xbuf, sh, sx, ox, 'row-major' );
96
97
*
98
+ * // Create a search element ndarray:
99
+ * var searchElement = scalar2ndarray( 4.0, {
100
+ * 'dtype': 'float64'
101
+ * })
102
+ *
103
+ * // Create a from index ndarray:
104
+ * var fromIndex = scalar2ndarray( 0, {
105
+ * 'dtype': 'int32'
106
+ * })
107
+ *
97
108
* // Find index:
98
- * var out = indexOf( x, 4.0 );
109
+ * var out = indexOf( x, searchElement, fromIndex );
99
110
* // returns <ndarray>
100
111
*
101
112
* var idx = out.get();
0 commit comments