Skip to content

Instantly share code, notes, and snippets.

@holyshared
Last active March 13, 2021 07:15
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 holyshared/7c40c1fdc243c1916b568594760a306b to your computer and use it in GitHub Desktop.
Save holyshared/7c40c1fdc243c1916b568594760a306b to your computer and use it in GitHub Desktop.
const al = (n) => {
let r = n;
for (let i = 1; i <= n - 1; i++) {
r = r * i;
}
return r;
};
console.log(al(2));
console.log(al(3));
console.log(al(4));
console.log(al(5));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment