Skip to content

Instantly share code, notes, and snippets.

@jefflombard
Last active December 26, 2018 19:57
Show Gist options
  • Select an option

  • Save jefflombard/731e1b17d01c36f6ad548983b03012c2 to your computer and use it in GitHub Desktop.

Select an option

Save jefflombard/731e1b17d01c36f6ad548983b03012c2 to your computer and use it in GitHub Desktop.
An example of progressively building out a function with comment driven development.
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