best-programming-club-12-06-20

Assignment

Open index.html in your default browser by double-clicking the file. Keep your browser console open so that you can view console logs.

Part 1: Update the cart total by changing the lines inside the initializeCartWithCount function. (Hint: Review the "Variables" section in this guide.)

Part 2 (optional): Once complete, try the same thing using the initializeCartWithList function. (Hint: Review the "Objects" section in this guide.)

Getting the assignment

You can pull down the assignment in one of 2 ways:

  1. Using a new repo: Fork this repo and then clone it. You should now have an exact copy of this repo, linked to your GitHub account, and can commit and push to the repo.
  2. Using an existing repo: Open the index.html file in GitHub and copy the code. Create a new file in your existing repository and paste in the code. Commit and push to your repo.

Make sure to commit your changes as you're making progress on the assignment. You'll receive feedback on the commit messages. Remember, commit messages should be short and sweet, in present-tense with an imperative tone. For example:

rename cart variable

(Tip: If you're completing both parts of the assignment, create a minimum of 2 commits, one for each assignment.)

Don't be afraid to commit code that's not working yet. Don't get discouraged if you can't get it to work--focus on reading the existing code and making your best guess at what the code might look like.

The "answers"

Check out the completed-assignment branch for possible ways to complete the assignment.