Key Concepts

Review core concepts you need to learn to master this subject

if Statement

var halloween = true if halloween { print("Trick or treat!") } // Prints: Trick or treat!

An if statement executes a code block when its condition evaluates to true. If the condition is false, the code block does not execute.

Conditionals
Lesson 1 of 2

What you'll create

Portfolio projects that showcase your new skills

Pro Logo

How you'll master it

Stress-test your knowledge with quizzes that help commit syntax to memory

Pro Logo