04. Strange data types

Booleans

The boolean type variable is used in control-flow, which we will get to in the next section.

The two types it may hold are true and false.

Usually you don't declare a variable, but you rather use an expression that evaluates to a boolean value - true or false.

Null

nullsimply means nothing. It represents and evaluates to false. However, this does not mean it's empty.

var myVariable = ''; // myVariable is empty, but not null. 

Undefined

undefined means a variable that hasn't yet contained a value.

Aching back from coding all day?

Inversion Therapy Table

Aching back from coding all day? Try Back Problems

Stretch out your back and relieve your back muscles with inversion therapy. This device counteracts the forces of gravity on the body by decompressing and elongating the spine. By using this product just ten minutes a day, you can be well on your way to improved circulation and posture while relieving muscle aches, back pain and stress.

$$ Check price
119.98119.98Amazon 4.5 logo(1,700+ reviews)

More Back Problems resources

Build modern and responsive webpages

JavaScript & JQuery

Build modern and responsive webpages Try Front-end

This book was written for anyone who wants to use JavaScript to make their websites a little more interesting, engaging, interactive, or usable. In particular, it is aimed at people who do not have a degree in computer science (well, not yet anyway).

$ Check price
39.9939.99Amazon 4.5 logo(385+ reviews)

More Front-end resources

Ad