Conditionals

if condition
{
    // code
}
else if condition2
{
    // more code
}
else
{
    // even more code
}


val result = if condition { value1 } else { value2 }thp
    
Syntax error: Expected an expression after the equal `=` operator at line 15:12

Check for datatypes

if variable is Datatype
{
    // code using variable
}thp
    
Syntax error: Expected a block after the condition at line 1:12

If variable is of enum

TBD

val user_id = POST::get("user_id")

if Some(user_id) = user_id
{
    print("user_id exists: {user_id}")
}

if Some(user_id) = user_id && user_id > 0
{
    print("user_id is greater than 0: {user_id}")
}thp
    
Syntax error: Expected an expression after the equal `=` operator at line 1:12