Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript truthy values and falsy values

// Truthy values

/*
	true
    {}
    []
    42
    "0"
    "false"
    new Date()
    -42
    12n
    3.14
    -3.14
    Infinity
    -Infinity
*/


// Falsy values

/*
  false
  0
  -0
  0n
  "", '', ``
  null
  undefined
  NaN
*/
 
PREVIOUS NEXT
Tagged: #javascript #truthy #values #falsy #values
ADD COMMENT
Topic
Name
5+2 =