Fixed formatting problems and JSDoc (#131)

* Fixed formatting problems and JSDoc

* Added returns for JSDoc
This commit is contained in:
Alexandr Shulaev
2020-09-14 19:46:30 +04:00
committed by GitHub
parent d8da439590
commit 34df0a6d08
6 changed files with 54 additions and 24 deletions

View File

@@ -1,7 +1,10 @@
const fact = (x) => {
if (x === 1) {
return 1;
}
/**
* Consider the factorial of the number
* @param {number} x Number
* @returns {number} Result
*/
const fact = x => {
if (x === 1) return 1;
return x * fact(x - 1);
};