Created
January 5, 2014 04:45
-
-
Save guiomie/8264440 to your computer and use it in GitHub Desktop.
Robbies loop test
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 IsSubstractionZero(x, y){ | |
var substraction = y - x; | |
if(substraction === 0){ | |
return false; | |
} | |
return true; | |
} | |
var x = 0; | |
var y = 6; | |
while(IsSubstractionZero(x, y)){ | |
console.log("x=" + x + " y=" + y) | |
x++; | |
y--; | |
if(x === 10) | |
break; | |
} | |
console.log("Out of loop"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment