Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

truthy and falsy

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)
Source by developer.mozilla.org #
 
PREVIOUS NEXT
Tagged: #truthy #falsy
ADD COMMENT
Topic
Name
6+2 =