Skip to content

Commit d28bd4b

Browse files
committed
Update example
1 parent e133b8f commit d28bd4b

File tree

1 file changed

+18
-16
lines changed

1 file changed

+18
-16
lines changed

README.md

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,22 @@ New versions of the asset are uploaded with every release. The asset can be adde
4141
Documentation can be found [here](https://github.com/Bytebit-Org/roblox-ReverseArray/tree/master/docs), is included in the TypeScript files directly, and was generated using [TypeDoc](https://typedoc.org/).
4242

4343
## Example
44-
A brief description of the example
44+
In this example, an array is created, each value printed, a reversed array created, and then each of its values are printed
4545

4646
<details>
4747
<summary>roblox-ts example</summary>
4848

4949
```ts
50-
import { PackageClass, packageFunction } from "@rbxts/package-name";
50+
import { reverseArray } from "@rbxts/reverse-array";
5151

52-
export class PackageConsumer {
52+
const forwardArray = [1, 2, 3, 4];
53+
for (const value of forwardArray) {
54+
print(value)
55+
}
56+
57+
const backwardArray = reverseArray(forwardArray);
58+
for (const value of backwardArray) {
59+
print(value)
5360
}
5461
```
5562
</details>
@@ -58,21 +65,16 @@ A brief description of the example
5865
<summary>Luau example</summary>
5966

6067
```lua
61-
local PackageClass = require(path.to.modules["package-name"]).PackageClass
62-
local packageFunction = require(path.to.modules["package-name"]).packageFunction
63-
64-
local PackageConsumer = {}
65-
PackageConsumer.__index = PackageConsumer
68+
local reverseArray = require(path.to.modules["reverse-array"]).reverseArray
6669

67-
function new()
68-
local self = {}
69-
setmetatable(self, PackageConsumer)
70+
local forwardArray = [1, 2, 3, 4]
71+
for _, value in ipairs(forwardArray)
72+
print(value)
73+
end
7074

71-
return self
75+
local backwardArray = reverseArray(forwardArray)
76+
for _, value in ipairs(backwardArray)
77+
print(value)
7278
end
73-
74-
return {
75-
new = new
76-
}
7779
```
7880
</details>

0 commit comments

Comments
 (0)