Skip to content

Instantly share code, notes, and snippets.

@LESTADru
Created January 26, 2014 09:26
Show Gist options
  • Save LESTADru/8630522 to your computer and use it in GitHub Desktop.
Save LESTADru/8630522 to your computer and use it in GitHub Desktop.
Функция вычисляющая факториал через рекурсию
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<script>
function Factorial(n){
return (n!=1)?n*Factorial(n-1):n;
}
alert(Factorial(5));
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment