If statements
Felix Imbanga
Posted on March 20, 2024
Type end
immediately after typing the if
. Indent
elsif
is only when you need to check more than 2 conditions.
Causing code to execute is known as 'truthy'
Causing code to not execute is known as 'falsy'
Only nil
and false
are falsy.
!=
means not equivalent
p
if for quick inspection, pp
is for more human readable representations. especially with complex data structures.
In variables you can put methods on both sides to evaluate if
statements more concise.
&&
both statements have to be true
||
at least one statement has to be true.
💖 💪 🙅 🚩
Felix Imbanga
Posted on March 20, 2024
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.
Related
githubcopilot AI Innovations at Microsoft Ignite 2024 What You Need to Know (Part 2)
November 29, 2024