Skip to content

Instantly share code, notes, and snippets.

@john212
Created November 27, 2019 03: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 john212/4cad7158381af19d1e97a6daa2edd059 to your computer and use it in GitHub Desktop.
Save john212/4cad7158381af19d1e97a6daa2edd059 to your computer and use it in GitHub Desktop.
JS Bin // source https://jsbin.com/dodokeg
<!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">
// factorial function
// factorial of integer > 1
z = myFactorial(10);
document.write(z);
function myFactorial(z_)
{
counter = z_;
product = 1;
while (counter >= 1)
{
product = counter*product;
counter = counter - 1;
}
return product;
}
// → 55
</script>
<script id="jsbin-source-javascript" type="text/javascript">
// factorial function
// factorial of integer > 1
z = myFactorial(10);
document.write(z);
function myFactorial(z_)
{
counter = z_;
product = 1;
while (counter >= 1)
{
product = counter*product;
counter = counter - 1;
}
return product;
}
// → 55</script></body>
</html>
// factorial function
// factorial of integer > 1
z = myFactorial(10);
document.write(z);
function myFactorial(z_)
{
counter = z_;
product = 1;
while (counter >= 1)
{
product = counter*product;
counter = counter - 1;
}
return product;
}
// → 55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment