Skip to content

Commit 04d44aa

Browse files
Venkat-EntropikVenkat
andauthored
fix(curriculam): include initStack in stack implementation requirements (freeCodeCamp#66846)
Co-authored-by: Venkat <venkat@Venkats-MacBook-Pro.local>
1 parent 83bf9eb commit 04d44aa

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

curriculum/challenges/english/blocks/lab-implement-a-stack/69a92f0b9cc04bb0d5327bb5.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,14 @@ In this lab, you will implement a stack data structure using functions. A stack
1313

1414
**User Stories:**
1515

16+
1. You should have an `initStack` function that returns an object with a `collection` property set to an empty array.
1617
1. You should have a `push` function that adds an element to the top of the stack.
1718
1. You should have a `pop` function that removes and returns the top element of the stack, or `undefined` if there isn't one.
1819
1. You should have a `peek` function that returns the top element of the stack without removing it, or `undefined` if there isn't one.
19-
1. You should have a `isEmpty` function that returns `true` if the stack contains no elements, and `false` otherwise.
20+
1. You should have an `isEmpty` function that returns `true` if the stack contains no elements, and `false` otherwise.
2021
1. You should have a `clear` function that removes all elements from the stack.
2122

22-
**Note:** Most tests depend on the `push` function. Implement `push` first, as tests for `pop`, `peek`, `isEmpty`, and `clear` require adding elements to the stack.
23+
**Note:** Most tests depend on the `initStack` and `push` functions. Implement them first, as tests for `pop`, `peek`, `isEmpty`, and `clear` require adding elements to the stack.
2324

2425
# --hints--
2526

0 commit comments

Comments
 (0)