Created
November 8, 2011 15:48
-
-
Save jjcall/1348127 to your computer and use it in GitHub Desktop.
Codeacademy Gist
This file contains 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 increment(start, timesToIncrement) { | |
var counter = 0; | |
while( counter !== timesToIncrement) { | |
start++ | |
} | |
return start; | |
} |
This file contains 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
// This function should increment the start value by 1 | |
// the number of times specified. | |
function increment(start, timesToIncrement) { | |
// Add the appropriate code here. You must update | |
// the condition in the while loop. You may want to | |
// create a new variable to keep track of how many | |
// times you have incrmeneted the variable. | |
while( ) { | |
start++; | |
} | |
return start; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
// This function should increment the start value by 1
// the number of times specified.
function increment(start, timesToIncrement) {
// Add the appropriate code here. You must update
// the condition in the while loop. You may want to
// create a new variable to keep track of how many
// times you have incrmeneted the variable.
var counter = 0;
while(counter < timesToIncrement) {
counter++;
start++;
}
return start;
}