Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Zaq Dayton
2,244 PointsI understand the difference between an external and internal parameter, but what's the point of an external one?
As stated, I understand the difference between the two. However, I can't think of a situation where I'd need to have a different external label when calling the function. Can someone give me an example of why I would need an external one? Nothing is coming up for me... Thanks!
Zaq Dayton
2,244 PointsZaq Dayton
2,244 PointsWell, correct me if I'm wrong, but I think I may have answered my own question. Hypothetically, if you have a two functions "calculateArea" and "calculateVolume", external parameter labels may help, because to calculate area you need "length" times "width", and to calculate volume you need "length" times "width" times "height". Therefore, if the internal parameters for each function were "length" and "height", then it may be confusing?
So, you could use external parameter labeling as such to avoid confusion:
However, the function that you call gives the context, so I'm not sure why it would be super confusing in this scenario. Can anyone still give me another one, and am I on the right track? Thanks!