Skip to content

Commit

Permalink
решил задачу с расчетом факториала
Browse files Browse the repository at this point in the history
  • Loading branch information
Данейкин Илья Вячеславович authored and Данейкин Илья Вячеславович committed Sep 24, 2024
1 parent c4f6a1b commit 733972c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion 1-module/1-task/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
function factorial(n) {
// ваш код...
let result = 1;
for (let i = n; i > 0; i--) {
result = result * i;
}
return result;
}

0 comments on commit 733972c

Please sign in to comment.