Truthy
adjective
say it: “TROO-thee” /ˈtruːθi/
A JavaScript value that counts as true in a condition, such as a non-empty string or any number but 0.
What is Truthy in JavaScript?
Truthy — A value treated as true when JavaScript evaluates it as a condition.
const name = "Ada";
let profileVisible = false;
if (name) {
profileVisible = true;
}
In a sentence
- “"Chai" is truthy, so if (name) runs the block.”
Level: Novice · More JavaScript terms at this level
Updated