Skip to content

Instantly share code, notes, and snippets.

@JNaeemGitonga
Last active March 30, 2017 12:12
Show Gist options
  • Save JNaeemGitonga/53920ac0b653738a413942a901f2290d to your computer and use it in GitHub Desktop.
Save JNaeemGitonga/53920ac0b653738a413942a901f2290d to your computer and use it in GitHub Desktop.
JS Bin// source https://jsbin.com/cehocul
<!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 computeArea(width, height) {
return width * height;
}
/* From here down, you are not expected to
understand.... for now :)
Nothing to see here!
*/
// tests
function testComputeArea() {
var width = 3;
var height = 4;
var expected = 12;
if (computeArea(width, height) === expected) {
console.log('SUCCESS: `computeArea` is working');
}
else {
console.log('FAILURE: `computeArea` is not working');
}
}
testComputeArea();
</script>
<script id="jsbin-source-javascript" type="text/javascript">function computeArea(width, height) {
return width * height;
}
/* From here down, you are not expected to
understand.... for now :)
Nothing to see here!
*/
// tests
function testComputeArea() {
var width = 3;
var height = 4;
var expected = 12;
if (computeArea(width, height) === expected) {
console.log('SUCCESS: `computeArea` is working');
}
else {
console.log('FAILURE: `computeArea` is not working');
}
}
testComputeArea();</script></body>
</html>
function computeArea(width, height) {
return width * height;
}
/* From here down, you are not expected to
understand.... for now :)
Nothing to see here!
*/
// tests
function testComputeArea() {
var width = 3;
var height = 4;
var expected = 12;
if (computeArea(width, height) === expected) {
console.log('SUCCESS: `computeArea` is working');
}
else {
console.log('FAILURE: `computeArea` is not working');
}
}
testComputeArea();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment