Skip to content

Instantly share code, notes, and snippets.

Created December 1, 2016 21:35
Show Gist options
  • Save anonymous/c75569f781d69facf44ad7f295947d77 to your computer and use it in GitHub Desktop.
Save anonymous/c75569f781d69facf44ad7f295947d77 to your computer and use it in GitHub Desktop.
Booleans Boolean studies // source http://jsbin.com/bameke
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="Boolean studies">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>Booleans</title>
</head>
<body>
<script id="jsbin-javascript">
// -----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"
</script>
<script id="jsbin-source-javascript" type="text/javascript">// -----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. */
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"</script></body>
</html>
// -----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"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment