From my understanding, I believe that var a = 1; is the only truthy and the rest are falsy’s - is this correct?

No.

  1. var a = 0;

    Number zero is falsy. However, note that the string zero "0" is truthy.

  2. var a = 10 == 5;

    This is same as var a = (10 == 5);, so this is falsy.

  3. var a = 1;

    var a = -1;

    Any non-zero number including negative numbers is truthy.

Quoting from MDN

In JavaScript, a truthy value is a value that translates to true when evaluated in a Boolean context. All values are truthy unless they are defined as falsy (i.e., except for false, 0, "", null, undefined, and NaN).

List of falsy values in JavaScript:From MDN

  1. false
  2. null
  3. undefined
  4. 0
  5. NaN
  6. '', "", ``(Empty template string)
  7. document.all
  8. 0n: BigInt
  9. -0
Answer from Tushar on Stack Overflow
🌐
GeeksforGeeks
geeksforgeeks.org › javascript › explain-the-concept-of-truthy-falsy-values-in-javascript
Explain The Concept of Truthy & Falsy Values in JavaScript - GeeksforGeeks
August 5, 2025 - This is truthy! Non-empty strings are truthy! Objects are truthy! Falsy values are values that evaluate to false when used in a Boolean. JavaScript has a fixed list of falsy values
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Glossary › Truthy
Truthy - Glossary | MDN
Examples of truthy values in JavaScript (which will be coerced to true in boolean contexts, and thus execute the if block): ... if (true); if ({}); if ([]); if (42); if ("0"); if ("false"); if (new Date()); if (-42); if (12n); if (3.14); if (-3.14); if (Infinity); if (-Infinity);
🌐
W3Schools
w3schools.com › js › js_booleans.asp
JavaScript Booleans
Boolean values are fundamental for logical operations and control flow in JavaScript programming. All JavaScript comparison operators (like ==, !=, <, >) return true or false from the comparison.
🌐
Medium
medium.com › @nehatanwar.dev › understanding-truthy-and-falsy-values-in-javascript-b1e18f01f3b5
Understanding Truthy and Falsy Values in JavaScript | by Nehatanwar | Medium
January 11, 2025 - In other words, if you use any of these values in an if or else statement, JavaScript will consider them as false. Truthy values are all values that are not falsy.
🌐
Sentry
sentry.io › sentry answers › javascript › truthy and falsy values in javascript
Truthy and falsy values in JavaScript | Sentry
The if condition will also evaluate to false if the loyaltyPoints field does not exist (making it undefined). We can fix our code by explicitly checking that user.loyaltyPoints does not equal undefined instead of evaluating the value’s truthiness.
🌐
Shameem
shameem.me › home › mastering the concept of truthy and falsy values in javascript
Mastering the Concept of Truthy and Falsy Values in JavaScript - Shameem
January 26, 2023 - Learn the basics of truthy and falsy values in JavaScript, including what they are, how to use them in conditional statements and logical operators, and common examples.
🌐
SitePoint
sitepoint.com › blog › javascript › truthy and falsy values: when all is not equal in javascript
Truthy and Falsy Values: When All is Not Equal in JavaScript — SitePoint
November 11, 2024 - Seemingly different values equate to true when compared with == (loose or abstract equality) because JavaScript (effectively) converts each to a string representation before comparison: ... A more obvious false result occurs when comparing with === (strict equality) because the type is considered: ... Everything else is an Object — including arrays. As well as a type, each value also has an inherent Boolean value, generally known as either truthy or falsy.
Find elsewhere
🌐
Turing
frontend.turing.edu › lessons › module-1 › js-truthy-falsy-expressions.html
JS: Truthy and Falsy Expressions - Front-End Engineering Curriculum - Turing School of Software and Design
Conditional An expression that evaluates to true or false, or a control flow statement that executes code · Truthy values In JavaScript, a truthy value is a value that is considered true when encountered in a Boolean context.
🌐
CodeSignal
codesignal.com › learn › courses › introduction-to-javascript-for-front-end-engineers › lessons › decoding-javascript-truthy-and-falsy-values-conditional-statements-logical-operators-and-equality-operations
Decoding JavaScript: Truthy and Falsy Values, Conditional ...
In JavaScript, a value can be considered 'truthy' or 'falsy'. If a value is interpreted as true in a context where a boolean is expected, it is considered 'truthy'. Conversely, if it is interpreted as false, it is considered 'falsy'. For example, 1 (the number one) is truthy, while 0 (the number ...
🌐
30 Seconds of Code
30secondsofcode.org › home › javascript › type › truthy and falsy values
What are truthy and falsy values in JavaScript? - 30 seconds of code
September 12, 2021 - Boolean(false); // false Boolean(undefined); // false Boolean(null); // false Boolean(''); // false Boolean(NaN); // false Boolean(0); // false Boolean(-0); // false Boolean(0n); // false Boolean(true); // true Boolean('hi'); // true Boolean(1); // true Boolean([]); // true Boolean([0]); // true Boolean([1]); // true Boolean({}); // true Boolean({ a: 1 }); // true ... JavaScript's Boolean function can be used for truth-checking data among other things.
🌐
freeCodeCamp
freecodecamp.org › news › javascript-if-statement-equality-and-truthy-falsy
JavaScript if Statements, Equality and Truthy/Falsy – Explained with Examples
March 21, 2023 - JavaScript has a unique sense of true and false, called truthy and falsy. Truthy and falsy are used when evaluating decision-criteria that aren't clearly true or false. Let's look at some examples.
🌐
Zipy
zipy.ai › blog › truthy-and-falsy-values-in-javascript
truthy and falsy values in javascript
April 12, 2024 - Be Explicit: When the distinction between different falsy values matters, use explicit checks (e.g., typeof variable !== 'undefined' or variable !== null) to avoid confusion and bugs. Understand Coercion: Familiarize yourself with how JavaScript coerces different values in Boolean contexts, especially when dealing with user input or data from external sources. Use Truthy and Falsy to Your Advantage: In many cases, truthy and falsy values can make your code more intuitive and succinct.
🌐
freeCodeCamp
freecodecamp.org › news › what-are-falsey-values-in-javascript
What are Falsy Values in JavaScript? Explained with Examples
April 2, 2025 - First is the string with the text ... considered a falsy value is an empty string. All non-empty strings in JavaScript are truthy values including strings with only whitespace....
🌐
LinkedIn
linkedin.com › pulse › mastering-truthy-falsy-values-javascript-key-efficient-mohammed-osman
Mastering Truthy and Falsy Values in JavaScript: A Key to Efficient Coding and Avoiding Pitfalls
May 28, 2023 - Truthy and falsy values are the backbone of conditional statements like if, else if, else, and logical operations like && (AND), || (OR), and ! (NOT). In an if statement, the condition inside the parentheses () is coerced into a Boolean value.
🌐
Adripofjavascript
adripofjavascript.com › blog › drips › truthy-and-falsy-values-in-javascript.html
Truthy and Falsy Values in JavaScript - A Drip of JavaScript
We don't need to explicitly check for undefined, "", etc. Instead we can just check whether person.skepticism is truthy. However, there some caveats to keep in mind. Firstly, this approach only works if all of the falsy values should be excluded (or included.)
🌐
DEV Community
dev.to › zachsnoek › what-are-truthy-and-falsy-in-javascript-j68
What Are Truthy and Falsy in JavaScript? - DEV Community
November 17, 2021 - Simply put, truthy values are true in a Boolean context and falsy values are false in a Boolean context. Hopefully this post helps you understand JavaScript values a little better.
🌐
Medium
medium.com › @maedevlin47 › boolean-bullying-you-b354b92b7308
Boolean Bullying You?. When first traveling down the pathway… | by Mae Schreck | Medium
July 9, 2025 - https://www.w3schools.com/js/js_booleans.asp · https://www.sitepoint.com/javascript-truthy-falsy/ Boolean · Beginners Guide · JavaScript · Beginner Javascript · 13 followers · ·17 following · Software Engineering Student At FlatIron School · Help · Status ·
🌐
Fridoverweij
library.fridoverweij.com › docs › jstutorial › data_type_conversion2.html
JavaScript Tutorial – Falsy, truthy & nullish
Falsy and truthy values are values that are coerced into false and true respectively, when encountered in a boolean context. ... All other values are truthy! This means that any non-empty string always coerces into true in a boolean context. Thus in JavaScript also "0" coerces into true!
🌐
Medium
medium.com › @rabailzaheer › truthy-falsy-values-and-equality-operator-a-javascript-guide-3a0760d85cc8
Truthy & Falsy Values and Equality Operator: A JavaScript Guide | by Rabail Zaheer | Medium
September 5, 2023 - A value that is truthy will be treated as equivalent to true when encountered in a conditional statement, while a falsy value behaves as if it were false. Falsy values encompass a range of non-boolean values that are treated as false in a Boolean ...