Skip to content

Commit 59a3f6c

Browse files
feat: update truthy falsy file
1 parent 634eac3 commit 59a3f6c

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

part1 (Basics)/03_truthy&falsy.js

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,11 @@
1-
// truthy-falsy.js
2-
3-
// INFO: What are Truthy and Falsy Values?
4-
5-
/*
1+
/* INFO: What are Truthy and Falsy Values?
62
In JavaScript, every value is either "truthy" or "falsy" when evaluated in a Boolean context (like inside an if condition).
73
8-
- **Falsy values** are those that are considered false when converted to a Boolean.
9-
- **Truthy values** are all other values that are considered true.
10-
11-
Knowing which values are falsy helps avoid bugs and write cleaner conditions.
12-
13-
---
4+
- Falsy values** are those that are considered false when converted to a Boolean.
5+
- Truthy values** are all other values that are considered true.
6+
*/
147

8+
/*
159
JavaScript's falsy values are exactly these:
1610
1711
1. false
@@ -25,7 +19,7 @@ JavaScript's falsy values are exactly these:
2519
Everything else is truthy.
2620
*/
2721

28-
// NOTE: Falsy Values in JavaScript
22+
// Falsy Values in JavaScript
2923
if (!false) console.log("false is falsy");
3024
if (!0) console.log("0 is falsy");
3125
if (!-0) console.log("-0 is falsy");

0 commit comments

Comments
 (0)