javascript factorial of a number
function factorialize(num) {
if(num < 2) return 1;
return num *= factorialize(num - 1);
}const factorial = n => n <= 1 ? 1 : n * factorial(n - 1);
// Examples
factorial(2); // 2
factorial(3); // 6
Also in JavaScript:
- discord js stats command
- add javascript keyup on input
- promise all in promise all
- javascript boolean
- change text size according to screen react native
- multiple image upload with preview and delete react js
- jquery alert
- jquery add element array
- electron remove default menu
- can i use redux connect without react
- circle collision javascript
- how to find the current date and time of a city in js
- build react app
- get data from api in javascript
- get form response with javascript
- console table javascript
- last element of an array javascript
- using aria attributes in angular
- get name of day javascript
- js strings
- jquery function return
- javscript insert element after another
- node-lambda run error fs-extra\lib\mkdirs\make-dir.js } catch { Unexpected token
- javascript check if not null