Skip to content

Instantly share code, notes, and snippets.

@aidev13
Created December 11, 2023 22:09
Show Gist options
  • Save aidev13/5b11c6be7ae392ab9d0407e302c911ab to your computer and use it in GitHub Desktop.
Save aidev13/5b11c6be7ae392ab9d0407e302c911ab to your computer and use it in GitHub Desktop.
The 6 falsy values

There are 6 falsy values in JavaScript

Fasly values

// Fasly values
// - False
// - 0
// - Empty string with quotes
// - null
// - undefined
// - NaN

Keep it type coercion that happens in Javascript,

Type coercion refers to the automatic conversion of values from one data type to another, typically performed during operations or comparisons involving different data types. By using Type Coercion, JavaScript attempts to make the data types compatible to complete the operation or comparison.

following this link for more information: https://developer.mozilla.org/en-US/docs/Glossary/Type_coercion

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment