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
tytyty
4,974 PointsYou said "Rather than hard coding the index value we can pass in the function argument or the method argument".
Do you mean:
Rather than hard coding the index value i.e. [4], we can pass in the function argument or the method argument called "index"?
Actually you could have named it anything right. You didn't have to name it "index" right? You are naming it "index" because you are referring to the index position of an array?
init(index: Int) {
let musicLibrary = MusicLibrary().library
let playListDictionary = musicLibrary[index]
}
Also, why is it MusicLibrary() with the empty parenthesis?