I’m from Belarus, but now live in Poland. I have graduated Belarusian state university, chemistry department and have worked as scientist in Belarus academy of sciences, then as master-data specialist in international company Danone. I really like studying new things and achieving new skills.
Write a function that returns the factorial of a given number.
function factorial(n) {
let result = 1;
for (let i = n; i >= 1; i -= 1) {
result = result * i;
}
return result;
}