Reusable Logic
Functions let you package logic into reusable blocks. You can call them whenever you need the same behavior.
This keeps code DRY and easier to maintain.
- Use functions for repeated tasks.
- Name functions clearly to express intent.
- Keep functions small and focused.