Created
March 28, 2018 00:54
-
-
Save timcarl/c3c4c7b5c5d3f8a9800291c713abf59f to your computer and use it in GitHub Desktop.
JS Bin // source https://jsbin.com/wirorav
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> | |
<head> | |
<meta name="description" content="[factorial on n!]"> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<script id="jsbin-javascript"> | |
function foo(n) { | |
result = 1; | |
for ( var x = 0; x < n; x++) { | |
result = result * (n-1); | |
} | |
return result; | |
} | |
console.log(foo(0)); | |
</script> | |
<script id="jsbin-source-javascript" type="text/javascript">function foo(n) { | |
result = 1; | |
for ( var x = 0; x < n; x++) { | |
result = result * (n-1); | |
} | |
return result; | |
} | |
console.log(foo(0));</script></body> | |
</html> |
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
function foo(n) { | |
result = 1; | |
for ( var x = 0; x < n; x++) { | |
result = result * (n-1); | |
} | |
return result; | |
} | |
console.log(foo(0)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment