โจ
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