You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`fillAllInPlace(array, value)` fills the entire provided `array` with the provided `value`.
53
+
54
+
Beware this will *mutate* the array.
55
+
56
+
See [`Array.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/fill) on MDN.
57
+
58
+
## Examples
59
+
```rescript
60
+
let myArray = [1, 2, 3, 4]
61
+
myArray->Array.fillAllInPlace(9)
62
+
63
+
Console.log(myArray) // [9, 9, 9, 9]
64
+
```
65
+
*/
66
+
@send
67
+
external fillAllInPlace: (array<'a>, 'a) => unit = "fill"
68
+
69
+
/**
70
+
`fillInPlaceToEnd` fills the entire provided `array` with the provided `value`, starting from the index provided to `start`.
71
+
72
+
Beware this will *mutate* the array.
73
+
74
+
See [`Array.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/fill) on MDN.
75
+
76
+
## Examples
77
+
```rescript
78
+
let myArray = [1, 2, 3, 4]
79
+
myArray->Array.fillInPlaceToEnd(9, ~start=1)
80
+
81
+
Console.log(myArray) // [1, 9, 9, 9]
82
+
```
83
+
*/
84
+
@send
85
+
external fillInPlaceToEnd: (array<'a>, 'a, ~start: int) => unit = "fill"
86
+
87
+
/**
88
+
`fillInPlace` fills the entire provided `array` with the provided `value`, starting from the index provided to `start`, going to the index provided to `end`.
89
+
90
+
Beware this will *mutate* the array.
91
+
92
+
See [`Array.fill`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/fill) on MDN.
`slice(array, start, end)` creates a new array from the provided `array`, with all items from `array` starting from `start`, stopping _before_ `end` (`end` is not included).
373
+
374
+
See [`Array.slice`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice) on MDN.
0 commit comments