@rbxts/reverse-array
v1.0.3
Published
A simple function that just reverses any array given to it.
Downloads
30
Readme
Reverse Array
Reverse Array is a simple function that just reverses any array given to it.
Installation
roblox-ts
Simply install to your roblox-ts project as follows:
npm i @rbxts/reverse-array
Wally
Wally users can install this package by adding the following line to their Wally.toml
under [dependencies]
:
ReverseArray = "bytebit/[email protected]"
Then just run wally install
.
From model file
Model files are uploaded to every release as .rbxmx
files. You can download the file from the Releases page and load it into your project however you see fit.
From model asset
New versions of the asset are uploaded with every release. The asset can be added to your Roblox Inventory and then inserted into your Place via Toolbox by getting it here.
Documentation
Documentation can be found here, is included in the TypeScript files directly, and was generated using TypeDoc.
Example
In this example, an array is created, each value printed, a reversed array created, and then each of its values are printed
import { reverseArray } from "@rbxts/reverse-array";
const forwardArray = [1, 2, 3, 4];
for (const value of forwardArray) {
print(value)
}
const backwardArray = reverseArray(forwardArray);
for (const value of backwardArray) {
print(value)
}
local reverseArray = require(path.to.modules["reverse-array"]).reverseArray
local forwardArray = [1, 2, 3, 4]
for _, value in ipairs(forwardArray)
print(value)
end
local backwardArray = reverseArray(forwardArray)
for _, value in ipairs(backwardArray)
print(value)
end