Skip to content

Instantly share code, notes, and snippets.

@kirilkirkov
Created November 25, 2022 09:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kirilkirkov/72f6098096a5a537e9ed11a888ef83ad to your computer and use it in GitHub Desktop.
Save kirilkirkov/72f6098096a5a537e9ed11a888ef83ad to your computer and use it in GitHub Desktop.
We All Love JavaScript with its stranges..

JavaScript Strange Behaviors

  • console.log(typeof NaN) // Number
  • console.log(Math.min() > Math.max()) // TRUE
  • console.log(9 - '1') // 8
  • console.log(9 + '1') // 91
  • console.log(Boolean(0.1 + 0.5 === 0.6)) // TRUE
  • console.log(Boolean(0.1 + 0.2 === 0.2)) // FALSE
  • console.log(! + []) // TRUE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment