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
Removes the last element from an array and returns the value.
@@ -185,7 +230,7 @@ lib.array.push(arr, ...)
185
230
186
231
**Returns:**
187
232
188
-
- length: `number`
233
+
- length: `integer`
189
234
190
235
### lib.array.shift
191
236
@@ -201,19 +246,92 @@ lib.array.shift(arr)
201
246
202
247
- element: `unknown`
203
248
249
+
### lib.array.slice
250
+
251
+
Creates a shallow copy of a portion of an array as a new array.
252
+
253
+
- arr: `Array`
254
+
- start?: `integer`
255
+
- finish?: `integer`
256
+
257
+
```lua
258
+
lib.array.slice(arr, start, finish)
259
+
```
260
+
261
+
**Returns:**
262
+
263
+
- newArr: `Array`
264
+
265
+
### lib.array.toReversed
266
+
267
+
Creates a new array with the order of its elements reversed from the given array.
268
+
269
+
- arr: `Array`
270
+
271
+
```lua
272
+
lib.array.toReversed(arr)
273
+
```
274
+
275
+
**Returns:**
276
+
277
+
- newArr: `Array`
278
+
279
+
### lib.array.unshift
280
+
281
+
Inserts new elements at the start of an array and returns the new array length.
282
+
283
+
- arr: `Array`
284
+
- ...: `any`
285
+
286
+
```lua
287
+
lib.array.unshift(arr, ...)
288
+
```
289
+
290
+
**Returns:**
291
+
292
+
- length: `integer`
293
+
204
294
### lib.array.reduce
205
295
206
296
The "reducer" function is applied to every element in an array, with the previous result serving as the accumulator.
207
297
If an initial value is provided it's used as the accumulator for the first index; otherwise iteration starts at the second index, with the first index as the accumulator.
0 commit comments