โœจ

Function

(Func-tion)

What is it? ๐Ÿค”

A function is like a Magic Spell that groups a bunch of steps together.

Instead of telling the robot every single tiny step every time, you give the whole list a name. Then you just say the name, and the robot does it all!

Example: Cleaning Your Room ๐Ÿงน

1. Pick up socks

2. Put in basket

3. Make bed

4. Vacuum floor

5. Dust shelf

6. Close closet

๐Ÿช„

Abracadabra!

cleanRoom()

Just say cleanRoom() and the magic happens!

๐Ÿ’ก Fun Fact

Functions can take "Ingredients" (called Arguments)! You could have a function called makeSandwich(jelly) or makeSandwich(ham).

๐Ÿ•ต๏ธ Secret Mission ๐Ÿ•ต๏ธ

PASSPORT CODE: SPELL