Created
September 1, 2013 15:03
-
-
Save stevencombs/6404969 to your computer and use it in GitHub Desktop.
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
// Divisible by Two, or any other value, Javascript function code | |
// Dr. Steven B. Combs, coding novice | |
var isDivisible = function(number) { | |
if (number % 2 === 0) { // Number 2 could be any value | |
return true; // Return true if value is divisible by 2 | |
} else { | |
return false; // Return false if value is not divisible by 2 | |
} | |
}; | |
isDivisible (4); // Replace value between parenthesis to evaluate | |
// Modification: Request user input for both values |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment