Welcome to the Treehouse Community
The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.
Not getting what things a function needs to work.
So can anyone tell me the things I need to learn to make a function work? and frankly speaking, I simply don't understand functions.
Steven Parker218,692 Points
A function is basically a "subprogram".
It can be called on to run by another part of the program (including from a function). Like the program itself, it contains a sequence of statements to be performed.
Optionally, a function can be given (we usually say "passed") one or more values to work with. And when it finishes, it can return a value back to the part of the program that called it.
Tina Maddox28,102 Points
Please let me know if you have any questions.