Created
November 11, 2015 22:44
-
-
Save anonymous/5c709a0209f04243768d to your computer and use it in GitHub Desktop.
So Last Year Function Complete // source http://jsbin.com/hedifo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>So Last Year Function Complete</title> | |
| </head> | |
| <body> | |
| <script id="jsbin-javascript"> | |
| /* | |
| So Last Year Function | |
| Directions: Make a program that tells you the grade and age you were last year | |
| Instructions: | |
| 1. Declare a function called lastYear. | |
| 2. Give the function a parameter named year. | |
| 3. In the body of the function, make a return statement that subtracts one from the parameter. | |
| 4. Create two console.log statements. | |
| 4a. one statement should print the grade you were in last year | |
| 4b. one statement should print the age you were in last year | |
| */ | |
| //Write your code on the next line | |
| function lastYear(year){ | |
| return year - 1; | |
| } | |
| console.log("Last year was the year " + lastYear(2015)); | |
| console.log("Last year I was in the " + lastYear(11) + "th grade"); | |
| </script> | |
| <script id="jsbin-source-html" type="text/html"> | |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>So Last Year Function Complete</title> | |
| </head> | |
| <body> | |
| </body> | |
| </html> | |
| </script> | |
| <script id="jsbin-source-javascript" type="text/javascript">/* | |
| So Last Year Function | |
| Directions: Make a program that tells you the grade and age you were last year | |
| Instructions: | |
| 1. Declare a function called lastYear. | |
| 2. Give the function a parameter named year. | |
| 3. In the body of the function, make a return statement that subtracts one from the parameter. | |
| 4. Create two console.log statements. | |
| 4a. one statement should print the grade you were in last year | |
| 4b. one statement should print the age you were in last year | |
| */ | |
| //Write your code on the next line | |
| function lastYear(year){ | |
| return year - 1; | |
| } | |
| console.log("Last year was the year " + lastYear(2015)); | |
| console.log("Last year I was in the " + lastYear(11) + "th grade");</script></body> | |
| </html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| So Last Year Function | |
| Directions: Make a program that tells you the grade and age you were last year | |
| Instructions: | |
| 1. Declare a function called lastYear. | |
| 2. Give the function a parameter named year. | |
| 3. In the body of the function, make a return statement that subtracts one from the parameter. | |
| 4. Create two console.log statements. | |
| 4a. one statement should print the grade you were in last year | |
| 4b. one statement should print the age you were in last year | |
| */ | |
| //Write your code on the next line | |
| function lastYear(year){ | |
| return year - 1; | |
| } | |
| console.log("Last year was the year " + lastYear(2015)); | |
| console.log("Last year I was in the " + lastYear(11) + "th grade"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment