Created
February 20, 2015 13:42
-
-
Save angvishvish/73a641acd08d68953484 to your computer and use it in GitHub Desktop.
Division by 3, 5 and both
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Document</title> | |
</head> | |
<body> | |
<script type="text/javascript"> | |
var check = function (number) { | |
if(number%3 == 0 && number%5 == 0) { | |
console.log('Mix - ' + number); | |
} else if(number%3 == 0) { | |
console.log('Fizz'); | |
} else if (number%5 == 0) { | |
console.log('Bizz'); | |
} else { | |
console.log(number); | |
} | |
if (number != 0) { | |
return check(number - 1); | |
} | |
} | |
check(100); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment