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 trialroohart
5,529 PointsEnums & Structs Default values
Why did we create a variable called type in the video? I don't understand the purpose of that in the code or is it supposed to be just an example? Example of what exactly?
Thanks for any help ! :)
1 Answer
Marina Alenskaja
9,320 PointsHi! :-)
The reason he created the variable named type, is just to illustrate that the object "Contact" can have multiple properties - first name, last name, and "type" - which means what type of relation it is. It could be a friend, your mom or your dogwalker. It's an example of how complex the objects can be. I hope that makes sense :-)
roohart
5,529 Pointsroohart
5,529 PointsIt totally does make sense now! Thanks Marina for opening it up :)