Skip to content

Instantly share code, notes, and snippets.

@JNaeemGitonga
Last active March 30, 2017 12:20
Show Gist options
  • Save JNaeemGitonga/3d9ab538b4669abe715d3818533e5f4e to your computer and use it in GitHub Desktop.
Save JNaeemGitonga/3d9ab538b4669abe715d3818533e5f4e to your computer and use it in GitHub Desktop.
JS Bin// source https://jsbin.com/gukoga
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
function isDivisible(divisee, divisor) {
return divisee % divisor === 0;
}
/* From here down, you are not expected to
understand.... for now :)
Nothing to see here!
*/
// tests
function testIsDivisible() {
if (isDivisible(10, 2) && !isDivisible(11, 2)) {
console.log('SUCCESS: `isDivisible` is working');
}
else {
console.log('FAILURE: `isDivisible` is not working');
}
}
testIsDivisible();
</script>
<script id="jsbin-source-javascript" type="text/javascript">function isDivisible(divisee, divisor) {
// your code here
}
/* From here down, you are not expected to
understand.... for now :)
Nothing to see here!
*/
// tests
function testIsDivisible() {
if (isDivisible(10, 2) && !isDivisible(11, 2)) {
console.log('SUCCESS: `isDivisible` is working');
}
else {
console.log('FAILURE: `isDivisible` is not working');
}
}
testIsDivisible();</script></body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment