Skip to content

Instantly share code, notes, and snippets.

@defields923
Forked from anonymous/index.html
Last active December 1, 2016 21:39
Show Gist options
  • Save defields923/974bca029b9e5ce1d74783b01b9a2268 to your computer and use it in GitHub Desktop.
Save defields923/974bca029b9e5ce1d74783b01b9a2268 to your computer and use it in GitHub Desktop.
BooleansBoolean studies// source http://jsbin.com/bameke
// -----Data Types: BOOLEAN----- //
/* A boolean is a data type that has one of two mutually
exclusive values: true or false. A boolean acts like an "on-off"
switch, where "true = on" and "false = off." They are used in
conjunction with comparion operators to evaluate expressions.
When comparing letters and non-alphnumeric characters, the
character will resolve to its Unicode number, which will be
used to make the comparison. When comparing strings, Javascript
compares individual characters from left to right. */
"use strict";
console.log(1 < 2); // true
console.log("A" < "a"); // true, uppercase letters always have
//a unicode number less than lowercase letters
console.log(false === false); // still true
console.log(false !== false); // false
console.log("AAAAa" > "AAAAA"); // true
console.log("✊" < "✋" && "✋" < "✌"); // true, Unicode knows
//how to play "rock, paper, scissors"
console.log("✊" > "✌"); // false, well, it's not perfect.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment