🟡 Truthy & Falsy Values 🟡
A large part of using JS is dealing with booleans.
Whether it is conditional rendering or an if statement. Booleans are everywhere.
For this reason, it's important to know about truthy & falsy values. Do you?
Let's check them out. 🧵 👇 1/5
❓ What do Truthy and Falsy mean?
👉 If we say a value is "truthy", this means that the value will be evaluated to true in a logical comparison.
👉 Similarly, if a value is "falsy" it means that in a logical comparison it would evaluate to false.
1️⃣ Truthy Values
👉 In JS any value by default is a truthy value unless it has been defined as a falsy value.
What this means is any time you create a value unless it's one from the list of falsy values, it will be truthy.
2️⃣ Falsy Values
👉 If a value is created as one of the values on the list of falsy values then it will evaluate to false.
Unlike truthy only certain values will be falsy. Check out the 🖼️ for the entire list.
📚 Read more about [[IsHTMLDDA]]:
🔗 Links in this Tweet:
Did you enjoy this thread or find it helpful? If so I would greatly appreciate it if you would consider doing one of the following:
❤️ Like these tweets 🔄 Retweet the first tweet in this thread so others can see it. 👤 Follow me for more content like this.