Skip to content

Instantly share code, notes, and snippets.

@volkovasystems
Created November 24, 2019 22:24
Show Gist options
  • Save volkovasystems/4d2b25744e05dd4216fc340555411a0b to your computer and use it in GitHub Desktop.
Save volkovasystems/4d2b25744e05dd4216fc340555411a0b to your computer and use it in GitHub Desktop.
Small Factorial Code
function factorial( number ){
return (
eval(
Object
.keys(
Array(
(
(
isNaN( parseInt( number ) ) === false
)
? parseInt( number )
: NaN
)
)
.join( )
.split( "," )
)
.map( ( value ) => parseInt( value ) + 1 )
.join( "*" )
)
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment