Skip to content

Commit 6615add

Browse files
committed
feat: indexOf docs
1 parent 1809375 commit 6615add

File tree

1 file changed

+21
-0
lines changed
  • lib/node_modules/@stdlib/array/fixed-endian-factory

1 file changed

+21
-0
lines changed

lib/node_modules/@stdlib/array/fixed-endian-factory/README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,27 @@ v = arr.at( -100 );
338338
// returns undefined
339339
```
340340

341+
<a name="method-index-of"></a>
342+
343+
#### TypedArrayFE.prototype.indexOf( searchElement\[, fromIndex] )
344+
345+
Returns the first index at which a given element can be found in the typed array, or `-1` if it is not present.
346+
347+
```javascript
348+
var Float64ArrayFE = fixedEndianFactory( 'float64' );
349+
350+
var arr = new Float64ArrayFE( 'little-endian', [ 1.0, 2.0, 3.0, 4.0 ] );
351+
352+
var idx = arr.indexOf( 2.0 );
353+
// returns 1
354+
355+
idx = arr.indexOf( 5.0 );
356+
// returns -1
357+
358+
idx = arr.indexOf( 3.0, 3 );
359+
// returns -1
360+
```
361+
341362
<a name="method-every"></a>
342363

343364
#### TypedArrayFE.prototype.every( predicate\[, thisArg] )

0 commit comments

Comments
 (0)