-
-
Notifications
You must be signed in to change notification settings - Fork 804
/
Copy pathrepl.txt
82 lines (63 loc) · 2.22 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
{{alias}}( x, indices, mode )
Takes elements from an array.
If `indices` is an empty array, the function returns an empty array.
Parameters
----------
x: ArrayLikeObject
Input array.
indices: ArrayLikeObject<integer>
List of element indices.
mode: string
Specifies how to handle an index outside the interval [0, max], where
`max` is the maximum possible array index. If equal to 'throw', the
function throws an error. If equal to 'normalize', the function throws
an error if provided an out-of-bounds normalized index. If equal to
'wrap', the function wraps around an index using modulo arithmetic. If
equal to 'clamp', the function sets an index to either 0 (minimum index)
or the maximum index.
Returns
-------
out: Array
Output array.
Examples
--------
> var x = [ 1, 2, 3, 4 ];
> var y = {{alias}}( x, [ 1, 3 ], 'throw' )
[ 2, 4 ]
{{alias}}.assign( x, indices, mode, out, stride, offset )
Takes elements from an array and assigns the values to elements in a
provided output array.
Parameters
----------
x: ArrayLikeObject
Input array.
indices: ArrayLikeObject<integer>
List of element indices.
mode: string
Specifies how to handle an index outside the interval [0, max], where
`max` is the maximum possible array index. If equal to 'throw', the
function throws an error. If equal to 'normalize', the function throws
an error if provided an out-of-bounds normalized index. If equal to
'wrap', the function wraps around an index using modulo arithmetic. If
equal to 'clamp', the function sets an index to either 0 (minimum index)
or the maximum index.
out: ArrayLikeObject
Output array.
stride: integer
Output array stride.
offset: integer
Output array offset.
Returns
-------
out: ArrayLikeObject
Output array.
Examples
--------
> var x = [ 1, 2, 3, 4 ];
> var out = [ 0, 0, 0, 0 ];
> var arr = {{alias}}.assign( x, [ 1, 3 ], 'throw', out, 2, 0 )
[ 2, 0, 4, 0 ]
> var bool = ( arr === out )
true
See Also
--------