Skip to content

learn-co-curriculum/cssi-2.3-lab-functions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lab - Creating Functions In Javascript

Lets create some functions! Add your code to functions.js, and open index.html in the browser and check the dev inspector to see your results!

1. A Bit Nervous

Sometimes we aren't totally sure - let's make a function to hedge our statements.

Create a function that adds "...I think" to strings, so that a string like "Functions are lists of instructions" becomes "Functions are lists of instructions...I think"

2. Today I learned

Other times we want to announce to the world what we learned! Let's make another function.

Create a function that adds "Today I learned " before string statements "Functions can take multiple inputs but only return a single output" becomes "Today I learned Functions can take multiple inputs but only return a single output"

3. Sales Tax Checkout

Remember the checkout function? Well, with the new 9.5% Seattle sales tax, we need to write a new checkout function so our cashier doesn't have to calculate all that on their own. We also want to be able to use the value in other calculations, so don't forget to return the value, not just print it out.

Add the 9.5% tax to the checkout function.

View Lab - Creating Functions In Javascript on Learn.co and start learning to code for free.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published