- 
                Notifications
    
You must be signed in to change notification settings  - Fork 1
 
indexOf
        Subhajit Sahu edited this page Feb 3, 2021 
        ·
        14 revisions
      
    Find first index of a value.
Alternatives: indexOf, lastIndexOf.
Similar: search, indexOf, hasValue, includes.
function indexOf(x, v, i)
// x: an iterable
// v: search value
// i: start index [0]const xiterable = require('extra-iterable');
var x = [1, 2, 3, 2, 5];
xiterable.indexOf(x, 2);
// → 1      ^
var x = [1, 2, 3, 2, 5];
xiterable.indexOf(x, 2, 2);
// → 3            ^