=
is different to the conditional operator ==
. event though they look similar, the single one is for assigning values, and the double one is for comparing values.if
keyword evaluate to true
, then that block will run, otherwise the else
block will run if present (you don't need to include an else block)