Skip to content

Boolean

The boolean data type is for storing either true or false


Syntax

To create a new boolean:

1
var foo = true;

Properties

A property is a special feature of a variable that can be used to get and/or set some aspect of that variable.

type

The type property can be used to find out the data-type of a particular boolean variable. The result will always be "boolean"

1
var result = foo.type;

Functions

invert( boolean x )

The invert function changes true into false, or false into true

1
shouldISleepNow.invert();