You've learned the principles of clean function design. Now let's practice applying these concepts to create better, more organized code.
Engagement Message
Ready to design functions like a pro?
Type
Swipe Left or Right
Practice Question
Match each scenario with the best approach by swiping left or right.
Labels
- Left Label: Create a Function
- Right Label: Keep Code Inline
Left Label Items
- You need to validate email addresses in 3 different forms
- You're calculating shipping costs for multiple order types
- You're formatting phone numbers throughout your app
- You're converting currencies in several places
Right Label Items
- You need to print "Hello" once at the start of your program
- You're adding 1 to a counter variable one time
- You're checking if a single variable is undefined
- You're setting a background color for one element
Type
Fill in The Blanks
Markdown With Blanks
Complete this function name to follow good naming conventions.
Suggested Answers
- combineNames
- isValidEmail
- processInput
- handleData
Type
Sort Into Boxes
Practice Question
