Skip to content

Latest commit

 

History

History

day_4

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Day 4 - Functions and Return Values

On day 1 of the prework, you learned how to store information in variables. Today, you will learn about another way to store information; more specifically, how to use Functions to create Return Values. In programming, we often use functions, so this is an important concept to get familiar with!

When you are all done with the lessons, exercises, and questions for today, you will once again use git to save your work, and then put it in the cloud on GitHub.

Open your local copy of frontend-mod-1-prework

Using your terminal, open the local copy of the repository that you created during setup. To do this, you will need to use the terminal command cd to change into the directory that holds the repository. Once you are in the correct directory, use the terminal command atom . to open the prework repository. If you are having trouble with this, see the day_1 instructions.

Functions & Return

  1. Read page 88, and pages 90 through 94 from the JAVASCRIPT & JQUERY: interactive front-end web development book.

  2. Read page 98 from the JAVASCRIPT & JQUERY book and then work through the functions-and-variables.js file in the day_4/exercises directory to learn more about variable scoping and mutation.

  3. Read about Javscript return statements: What is a Return Statement?.

  4. Work through the functions.js file in the day_4/exercises directory.

  5. Answer the questions in the questions.md file in the day_4 directory.

Save your work in Git

When you are finished with all of the day_4 activities, use your terminal to run the following commands in order to save your work to your local git repository.

  1. $ git add day_4/exercises
  2. $ git add day_4/questions.md
  3. Use git add day_4/<filename> to add all additional files that you created today
  4. $ git status - you should see only green filenames - if you see any that are red, continue to git add those files until git status shows all green files.
  5. $ git commit -m "Add Day 4 Work"

Push to Github

You've save your work to git on your local machine, but it is not yet accessible through your remote GitHub repository. Updating our remote GitHub repository with our local changes is called pushing. Push your code with the following command:

git push origin master

You should now be able to log in to GitHub, navigate to your remote prework repository and see all the work you did today!