In conditions, JavaScript converts non-boolean values to booleans. Most values are "truthy" (treated as true):
if ("hello") { } // truthy - runs
if (42) { } // truthy - runs
if ([]) { } // truthy - runs (empty array!)
if ({}) { } // truthy - runs (empty object!)
Any non-zero number, any non-empty string, and all objects/arrays are truthy. This lets you write shortcuts like if (username) to check if a string exists and isn't empty.