Prework Study Guide
✨ Open the Console to See What's Happening ✨
HTML
- The head element contains information about the webpage.
- The body element represents the visible content shown to the user.
CSS
- A margin indicates how much space we want around the outside of an element.
- A padding indicates how much space we want around the content inside an element.
BASH Commands
- ls :lists files and folders in dir
- cd .. :go to upper dir
- touch name :creates file
Git
- git status : checks what branch we are currently on
- git checkout main : checkout as main
- git checkout -b branch-name : creates a new branch and switches to it
- git add -A :command to commit all files in the working branch
- git commit -m "note about any changes commited to code"
JavaScript
- A variable is a named container that allows us to store data in our code.
- Control flow is the order in which a computer executes code in a script.
- To declare a function, we use the function keyword and then give our function a unique name followed by parentheses. Then we add curly brackets {} that contain the code for the task we want to perform. In our example, we created two separate functions: one for our for loop and one for our if statement.
- An array is a single variable that is used to hold a group of data. Arrays are typically used to hold data that is related in some way.
- A for loop uses the predictable pattern of indices to perform a task on all the items in an array by allowing a single code block to be executed over and over. Developers must use another statement, such as the conditional if statement that we just learned, to interrupt the control flow by executing a block of code a specific number of times.