Last active
December 26, 2018 19:57
-
-
Save jefflombard/731e1b17d01c36f6ad548983b03012c2 to your computer and use it in GitHub Desktop.
An example of progressively building out a function with comment driven development.
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
| function addFive(){ | |
| // Setup - Declare all variables that I will need. | |
| let inputNumber, newNumber; | |
| // Input - Handle any user input. | |
| inputText = prompt('Enter a numerical value'); | |
| // Transform - Compute any values once I have all dependencies. | |
| newNumber = inputNumber + 5; | |
| // Output - Display to user. | |
| return newNumber; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment