Mathematical tricks of Javascript

factorial formula

Factorial (n!):

Factorial definition formula

Recursive factorial formula

Now we solve the Recursive way

Fibonacci Series:

Prime Number:

Truthy Vs Falsy:

  • false
  • 0 (zero)
  • '' or "" (empty string)
  • null
  • undefined
  • NaN
  • '0' (a string containing a single zero)
  • 'false' (a string containing the text “false”)
  • [] (an empty array)
  • {} (an empty object)
  • function(){} (an “empty” function)

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Rima Wahid

Throughout my career as a front end developer I've emphasized the importance of scalable and well documented.