If / Else: Making Decisions
A fox reaches a river. If it has enough energy it leaps across; if not, it stops for a rest. Code can choose between two paths using if and else.
What you'll learn
Let your program pick between two different outcomes.
New command
if (energy > 50) { … } else { … }💻 Code Editorjs
🎬
Press Run Code to see your creation!