GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Docs
  • Types
  • Boolean

This view

  • Original page
  • New address

GeezerVison is showing maker.makecode.com — Boolean

Skip to main content
About FAQ Projects GitHub
Reference
music pins control serial
Blocks
On Start
Loops
repeat for while for of
Logic
if Boolean
Variables
assign change var var
Math JavaScript blocks Custom blocks
Python
Calling Sequencing Variables Operators Statements Functions Classes
JavaScript
Calling Sequencing Variables Operators Statements Functions Types Classes Interfaces Generics
Types
Number String Boolean Array Function
Miscellaneous
About Support Translate Sharing projects Offline support Save Reset Beta version Home page content
Developers
Command Line Interface Visual Studio Code support Blocks Embed

Boolean

Something that is only true or false.

A boolean has one of two possible values: true or false. The boolean (logical) operators (and, or, not) take boolean inputs and make another boolean value. Comparing on other types (numbers, strings) with logical operators create boolean values.

These blocks represent the true and false boolean values, which can be plugged in anywhere a boolean value is expected:

let on = true;
let off = false;
off = false;

You can set and compare other boolean values:

let on = true;
let off = !on;
let switcher = on;
let lights = off;

if (switcher) {
    lights = on;
} else {
    lights = off;
}

Compare other types:

let cool = 50;
let temp = 65;
let warming = temp > cool;

if (warming) {
    let message = "It's warming up."
}

See Also

boolean (blocks)

Edit this page on GitHub
Edit template of this page on GitHub
Edit template of this page on GitHub

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.