web-tech/tasks/math-funcs/funcs/pow.js
2025-11-23 14:00:44 +03:00

7 lines
No EOL
116 B
JavaScript

function pow(x, n) {
let result = 1;
for (let i = 0; i < n; i++) {
result *= x;
}
return result;
}