Skip to content

bloominstituteoftechnology/Web-Foundations-Module-7

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

Lambda Foundations

Module 7 - Javascript - Arrays

Module 7 Project

Today we learned about a way to store collections of items in Javascript. It is our first data structure, the almighty array. We also learned about a couple of the array's properties and methods.

Getting Started

In order to get started you will need to download this project as a .zip file and open it in VS Code (like Modules 1 and 2). Here are the instructions to do so:

  1. Click on the Green button that says Code in the upper right-hand side of the screen.
  2. You will see an option at the bottom called Download Zip.
  3. You will need to find the place the .zip file is downloaded to. This will usually be the Downloads folder on your computer. Tip: if you are using Chrome, you should be able to click on the download itself in the bottom left-hand corner of your browse, this will open the location of the downloaded file in My Computer or Finder.
  4. Double-click on the .zip file itself. Once you unzip the file you should see a Folder or Directory with the name "Web-Foundations-Module-7" next to the .zip file.
  5. Either drag and drop the entire folder onto the VS Code icon, OR open VS Code -> click on File > Open -> Find the folder from step 4 -> Click open.
  6. Open the index.html file in your browser. In most cases you can drag and drop the HTML file directly to your open browser screen.

Analyze the Code

Before you open the project, one thing to note. A LOT of code has already been written. This may be overwhelming at first, that's OK! Take a moment and just analyze the code that has already been written. Are there elements that you recognize? Are there elements that you've never seen before? Take note of these things. A major skill in software development is learning to read the code that is already there and figuring out where to insert your own code. We've done that step for you today but as an exercise try and answer the questions below: (All questions refer to the Analyze.js file)

  1. On line 11, how many animals are in the enclosure?

[Write Your Answer Here]

  1. On what line is an animal being removed from an array?

[Write Your Answer Here]

  1. On What line is a new enclosure being added to the zoo array?

[Write Your Answer Here]

  1. How many total enclosure arrays are in the zoo array?

[Write Your Answer Here]

  1. How many total animals are in enclosure arrays?

[Write Your Answer Here]

Try it out

The Try it Out portion of this project will take place in two parts.

Part One: The first part is located in the TryIt.js file.

  • In this file you will assign the variable finalArray to an empty array.
  • Read the instructions carefully, You will be calculating the location of the items index.
  • Place all items in the array based on their calculated index.
  • When you are complete, link the TryIt.js file to the index.html file.
  • Open the index.html file in your browser. You should see a big button at the top of the screen. Press it!
  • If you are successful, congratualtions! If not, don't sweat it, go back and try again until you get it just right!
  • When you are complete move on to the next section.

Part Two:

  • Now with your function working correctly and the index.html file open in your browser, answer the quiz questions. Be sure to pay attention to detail and read the code carefully.
  • Once you get 29/31 questions correct, the password will appear at the bottom of the screen.
  • You may need to work through the questions multiple times in order to get a passing score. This is by design, the more time you spend reading and analyzing code, the faster you will pick it up!

**Password: ** [Write Password Here]

Go further

In this section, we'd like you to take your learning into your own hands! It is an important skill to be able to find the answers you are seeking on the internet while working on a software project. In today's case, Google will be your friend. We've highlighted some potential Google search phrases, but try to think of how you would word your search on your own.

  1. We've learned about 4 array methods today. Do some research on Array Methods, and discover 4 more. You don't need to know how to use them, but you should do enough research to know what they do.

Method One:

Method Two:

Method Three:

Method Four:

In Your Own Words

An impactful technique in learning something new is attempting to reiterate the concepts you just learned from memory in your own words. This allows you to highlight areas you are not comfortable with and could study on a little more. We'll start this exercise off pretty simply. Just remember that this is merely an exercise, there are no right or wrong answers here. Please answer the following question in your own words

  1. What is an Array?

[Write Your Answer Here]

  1. What does index mean in the context of an array?

[Write Your Answer Here]

  1. Why do you think an array's index starts at 0 and not 1?

[Write Your Answer Here]

Complete the Assignment

Once you are completed with all of the above exercises, find the Folder Web-Foundations-Module-7 in your Finder or My Computer. Right-click on the folder and select "Compress Web-Foundations-Module-7". This will create a .zip file. Upload this .zip file to Canvas.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •