-
-
Notifications
You must be signed in to change notification settings - Fork 809
/
Copy pathrepl.txt
47 lines (34 loc) · 1.27 KB
/
repl.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
{{alias}}( x, searchElement, fromIndex, equalNaNs )
Returns the index of the first element which equals a provided search
element.
If provided an array-like object having an `indexOf` method and `equalNaNs`
is `false`, the function defers execution to that method and assumes that
the method has the following signature:
x.indexOf( searchElement, fromIndex )
If provided an array-like object without an `indexOf` method or if
`equalNaNs` is `true`, the function performs a linear scan and returns
immediately upon finding a match.
If unable to find an element which equals a provided search element, the
function returns -1.
Parameters
----------
x: ArrayLikeObject
Input array.
searchElement: any
Search element.
fromIndex: integer
Starting index (inclusive). If less than zero, the starting index is
resolved relative to the last array element, with the last array element
corresponding to `fromIndex = -1`.
equalNaNs: boolean
Boolean indicating whether NaNs should be considered equal.
Returns
-------
out: integer
Index or -1.
Examples
--------
> var out = {{alias}}( [ 1, 2, 3, 4 ], 3, 0, false )
2
See Also
--------