Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Add Function User Story
- 1) The user will be able to type an item into the input field.
- 2) The user will be able to add that item to the shopping list by pressing the add button.
- Pseudocode:
- 1) An event listener will be added to the form to check for submit.
- 2) The default behavior will be prevented for the form.
- 3) The value of the input field will be used to create a new object.
- 4) That object will be added to the Store.
- 5) The renderShoppingList function will be called to display the updated list.
- Check Function User Story
- 1) The user will be able to add a strike through the item by pressing a button tied to the item.
- 2) The user will be able to remove a strike though the item by pressing a button tied to the item.
- Pseudocode:
- 1) An event listener will be added to the list, listening for clicks on the check button.
- 2) On click, the checked value of the object literal will be toggled.
- 3) The renderShoppingList function will be called to display the updated list.
- Delete Function User Story
- 1) The user will be able to remove an item from the list by pressing a button tied to the item.
- Pseudocode:
- 1) An event listener will be added to the list, listening for clicks on the delete button.
- 2) On click, the associated value will be searched for in the array of objects, using the 'name' property.
- 3) Once found, the object will be popped from the array and discarded.
- 4) The renderShoppingList function will be called to display the updated list.
Add Comment
Please, Sign In to add comment