Skip to content

Instantly share code, notes, and snippets.

@angvishvish
Created February 20, 2015 13:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save angvishvish/73a641acd08d68953484 to your computer and use it in GitHub Desktop.
Save angvishvish/73a641acd08d68953484 to your computer and use it in GitHub Desktop.
Division by 3, 5 and both
<!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