Skip to content

Commit e70fd46

Browse files
authored
Update names to match convention
1 parent b68bf3e commit e70fd46

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

content/en-us/luau/stacks.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,18 @@ function Stack.new()
2626
end
2727

2828
-- Check if the stack is empty
29-
function Stack:IsEmpty()
29+
function Stack:isEmpty()
3030
return #self._stack == 0
3131
end
3232

3333
-- Put a new value onto the stack
34-
function Stack:Push(value)
34+
function Stack:push(value)
3535
table.insert(self._stack, value)
3636
end
3737

3838
-- Take a value off the stack
39-
function Stack:Pop()
40-
if self:IsEmpty() then
39+
function Stack:pop()
40+
if self:isEmpty() then
4141
return nil
4242
end
4343

@@ -57,21 +57,21 @@ local s = Stack.new()
5757

5858
-- Change the stack Resulting stack Output
5959

60-
s:Push(1) -- {1}
60+
s:push(1) -- {1}
6161

62-
s:Push(5) -- {1, 5}
62+
s:push(5) -- {1, 5}
6363

64-
s:Push(10) -- {1, 5, 10}
64+
s:push(10) -- {1, 5, 10}
6565

66-
print(s:Pop()) -- {1, 5} 10
66+
print(s:pop()) -- {1, 5} 10
6767

68-
print(s:Pop()) -- {1} 5
68+
print(s:pop()) -- {1} 5
6969

70-
s:Push(20) -- {1, 20}
70+
s:push(20) -- {1, 20}
7171

72-
print(s:Pop()) -- {1} 20
72+
print(s:pop()) -- {1} 20
7373

74-
print(s:Pop()) -- {} 1
74+
print(s:pop()) -- {} 1
7575
```
7676

7777
<Alert severity="warning">

0 commit comments

Comments
 (0)