JavaScript Booleans

Опубликовано: 10 Октябрь 2024
на канале: Chris Walker (technoblogical)
1,246
13

Video tutorial on JavaScript booleans. Booleans are a binary value. They equate to either true or false. That's a complex as they get. They are great for storing simple yes or no questions like whether someone is subscribed to your newsletter. Even variables have a true/false value. It's one of the weird quirks of any programming language.

Things that evaluate as true...
true
"true" (Strings are true!)
"false" (This is a string!)
numbers greater than zero
numbers less than negative zero
arrays (even empty ones)

Things that evaluate to false...
false
"" (empty strings)
0 (zero, the first number in computing)
-0 (negative zero)
undefined variables (Or anything undefined.)
null (In JavaScript, you can define things as nothing which is different than undefined.)

http://www.technoblogical.com/web-des...

Training videos since last Tuesday
http://www.technoblogical.com/
Thanks for watching!