Skip to content

Commit

Permalink
Факториал 5
Browse files Browse the repository at this point in the history
  • Loading branch information
Polina-Godun committed Dec 22, 2024
1 parent 359317a commit b7c3f70
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion 1-module/1-task/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
function factorial(n) {
// ваш код...
let value=1;
for (let i=1; i<=n; i++){
value*=i;
}
return value;
}
console.log (factorial(5));

0 comments on commit b7c3f70

Please sign in to comment.