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

iOS Swift 2.0 Functions Function Parameters Default Values

Wang Lei
Wang Lei
2,766 Points

About the external parameter

in this example

when we define the first function we code fun carpetCostCalculator (length length: Int, width: Int) but in another function calculateArea (length: Int, width width:Int) Why we put external parameter on first parameter length but not on 2nd "width"? Why in the 2nd function we add the external parameter on parameter "width" but not "length" Is the coding rule for external parameter is random? Thanks (Sorry I don't know if I express my point clearly or not)

Stephen Wall
Stephen Wall
Courses Plus Student 27,294 Points

Can you please tell me which exercise you are referring to? Thanks!

1 Answer

Wang Lei
Wang Lei
2,766 Points

Thank you so much!