truthy

A value that counts as true in a condition such as if (value), which is every value except the falsy ones.

In more detail

if (!param) return removes null and undefined, but also 0 and the empty string, which may be valid. Narrowing by truthiness is convenient but check that no legitimate falsy value is thrown away.

Related terms

Taught in

References