Skip to content

Latest commit

 

History

History
19 lines (10 loc) · 1.02 KB

booleans.md

File metadata and controls

19 lines (10 loc) · 1.02 KB

Bolleans

Introduction

What are Booleans or Bool ?

In programming, booleans, often abbreviated as bool, represent a data type with values of either false or true. Booleans are fundamental for making decisions in your code and controlling the flow of execution.

Conditionals

In Luau, the language we are exploring, conditional statements rely on the evaluation of expressions as either false or true. It's important to note that Luau considers values other than just false or nil as true. Surprisingly, even zero and an empty string are treated as true in Luau's conditional logic.

Operators

To create intricate conditions in Luau, you can use a variety of operators. These include both relational and logical operators, allowing you to compare values and combine conditions to make more complex decisions in your code.

Conclusion

Understanding Booleans, conditions and operators in Luau is essential to create effective decisions and control the flow of execution in your programs.