- use arrays to store and access data
- use array properties and array methods
Baskin Robins, a global chain of ice cream parlors, first opened in 1945 and served 31 flavors of Ice Cream. They have grown to almost 6,000 franchises world wide and have now became famous for serving exactly 31 flavors at a time. Since they first opened, they no longer serve the same 31 flavors, but they do always have exactly 31 ice cream flavors available.
Your challenge today will be to work with their array of ice cream flavors to access, remove, and add flavors, all while ensuring the length never exceeds 31.
Using VSCode and Command Line:
- Fork the repo
- Go into canvas and connect your repo to codegrade
- Clone your forked version of the repo
- DO NOT CREATE A BRANCH. You will be pushing your changes to the main/master today
- cd into your repo
- open the terminal in your vs code and type
npm install
- next type
npm run test
in your terminal - Complete your work making regular commits to main/master. Your codegrade score will update each time you make a push.
Find the file index.js
and complete the tasks until your returns look like the expected returns. Do not use any of the forbidden methods! Forbidden methods are .forEach()
, .map()
, .filter()
and .reduce()
Open a second terminal inside of your project by clicking on the split terminal icon
Inside of your second terminal type npm start
You will be running your tests in one terminal and debugging in the other. As you work on your code you should make use of console.log
to check your progress and debug.
There are several stretch goals inside index.js
. You may work on these once you have finished MVP requirements for the day!
Why aren't my results showing up in the console?
Make sure you are invoking your function after defining and wrapping a console.log around the invocation in order to view results in the console.
EXAMPLE: console.log(myFunction(argument))
🤝W3 Schools - JavaScript Arrays
Please submit your project via codegrade by following these instructions See part 2, submitting an assignment with codegrade