Back to Loop Challenge
Code Studio · Level 5

Real JavaScript Functions

A function stores several instructions under one name. Define the launch sequence once, then call its name whenever the rocket needs it.

FUNCTION = RECIPE CARDlaunchRocket()Write the recipe once. Use it again and again.
JavaScript Mission Control

Store the launch steps, then run them.


            
DEFINE creates the reusable recipe. It does not run yet. CALL uses launchRocket(); to run every step inside.

First, define the function so JavaScript knows the launch recipe.

Launch Simulator

No function is stored yet.

CALLS0 / 2
Rocket waiting on launchpad
FUNCTION NOT DEFINED
1. Check fuel2. Count down3. Launch
Define onceCall onceReuse the same function