
JavaScript falsy values comparison
Jun 3, 2023
JavaScript type conversion is sometimes confusing. I created a table to understand falsy values comparison with “==”. If “-” is put before undefined and NaN, it returns NaN. Others return 0.

JavaScript type conversion is sometimes confusing. I created a table to understand falsy values comparison with “==”. If “-” is put before undefined and NaN, it returns NaN. Others return 0.
Distraction-free reading. No ads.
Organize your knowledge with lists and highlights.
Tell your story. Find your audience.
Read member-only stories
Support writers you read most
Earn money for your writing
Listen to audio narrations
Read offline with the Medium app
5+ years Full Stack SWE (Ruby, Go, TypeScript, JavaScript) | Former Founding Engineer of AI Startup in Canada