# Web-Foundations-Module-4 **Repository Path**: mirrors_LambdaSchool/Web-Foundations-Module-4 ## Basic Information - **Project Name**: Web-Foundations-Module-4 - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-10-16 - **Last Updated**: 2026-07-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Lambda Foundations ## Module 4 - Javascript - Foundations ### Module 4 Project Welcome to the world of computer programming, and to the world of Javascript! As you know Javascript is a pivotal language in building the web. We would not have the internet as we know it without Javascript. For many of you this is your first programming language. We are going to take this pretty slow so that you understand all of the fundamentals of the language before we move onto harder things. In this project you will be completing a quiz and writing only a little bit of actual code. ### 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-4-main" 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: 1. On line 10 of `index.html` what is this element doing? [Write Your Answer Here] 2. On line 7 of `index.js` what primitive data type is the variable `favoriteFood` being assigned to? [Write Your Answer Here] 3. On line 3 of `index.js` what keyword is being used to create the variable? [Write Your Answer Here] 4. On line 11 of `index.js` can you spot the error? Why would this line cause an error? [Write Your Answer Here] 5. On line 13 of `index.js` can you spot the error? Why would this line cause an error? [Write Your Answer Here] 6. In `index.js` what would be the result if we wrote this code: `petsOwned * age`? [Write Your Answer Here] ### Try it out There are two steps to the `Try It Out` section in today's assignment. **Step One**: - Open `index.js`. Delete or comment-out the code on lines 11 and 13 (if this code remains, it will not run). - Create a variable named `myName` and assign it to a String containing your name. - In `index.html` link to the `index.js` Javascript file. If everything works (hint: you will need to use the `async` flag) you should see some visual confirmation when you open `index.html` in your browser. That leads us to part 2: **Step Two**: - Now that you have properly linked index.js to the HTML file you can begin the quiz challenge. - On the page you will have 37 questions to answer. Take your time and examine to code properly before you answer. - If you score higher than a 34/37 you will be granted the password. - If you don't, that's OK! This quiz is not meant to be passed on the first try. Understand why your answer(s) were wrong and try again. Refresh the page and continue trying until you get the correct score. - Pay attention to the explanations as you answer these questions. Some of these may seem easy, but it is vital that these concepts are second nature to you as you move forward with Javascript! **Password:** [Once you have the password, write it 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. Step One: We're just starting our journey into Javascript, but there are already some areas that could use further investigation. On your own, research the `Math` object. You learned about a couple of the properties of the Math object today, read up on two more. Write them here and explain what they do: Property One: [Write Your Answer Here] Property Two: [Write Your Answer Here] Step Two: We learned a little bit about `reserved keywords`, these are keyword that Javascript has already assigned values to. This means that we can not use these words when creating variables (words like let, const, and var). On your own research reserved keywords. Find a list, pick three and write them below. Then, speculate on what they are used for. Why would these specific words be reserved? Word One: Word Two: Word Three: ### 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_ a string? Try to be as descriptive as possible. 2. What _is_ a variable? Try to be as descriptive as possible. ### Complete the Assignment Once you are completed with all of the above exercises, find the Folder `Web-Foundations-Module-4-main` in your Finder or My Computer. Right-click on the folder and select "Compress Web-Foundations-Module-4-main". This will create a .zip file. Upload this .zip file to Canvas. Congratulations, you've completed the assignment!