Created
August 28, 2018 13:43
-
-
Save LSStaff/f9ca1e99255cd1bdc1a5064fa8cdff05 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
var dividend = 18; | |
var numbers = [2, 3, 4, 5, 6, 7, 8, 9]; | |
var idx; | |
for (idx = 0; idx < numbers.length; idx++) { | |
var factor; | |
var divisor = numbers[idx]; | |
if (dividend % divisor === 0) { | |
factor = true; | |
} | |
if (factor) { | |
console.log(divisor + ' is a factor of ' + dividend + '!'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment