forked from stdlib-js/stdlib
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrepl.txt
More file actions
46 lines (32 loc) · 1.02 KB
/
repl.txt
File metadata and controls
46 lines (32 loc) · 1.02 KB
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
{{alias}}( x, clbk[, thisArg] )
Computes the midrange of an array via a callback function,
ignoring NaN values.
If provided an empty array, the function returns `NaN`.
The callback function is provided three arguments:
- value: current array element.
- index: current array index.
- array: the input array.
The callback function should return a numeric value.
If the callback function returns `NaN`, the value is ignored.
If the callback function does not return any value (or equivalently,
explicitly returns `undefined`), the value is ignored.
Parameters
----------
x: Array|TypedArray
Input array.
clbk: Function
Callback function.
thisArg: any (optional)
Execution context.
Returns
-------
out: number
Midrange.
Examples
--------
> function accessor( v ) { return v * 2.0; };
> var x = [ -2.0, 1.0, 3.0, -5.0, 4.0, NaN, -1.0, -3.0 ];
> {{alias}}( x, accessor )
-1.0
See Also
--------