Bummer! You have been redirected as the page you requested could not be found.

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

What is <T> or type T in swift?

https://teamtreehouse.com/library/closures-in-swift-2/building-standard-library-functions/map

Pasan has some code here that mentions <T> and has a return type of T. But I'm not sure what this is exactly.

1 Answer

T is just a generic placeholder to represent any Type.
You can actually use any letter or word, but T is used by convention.

The most commonly used generic type parameter names are:

E - Element 
K - Key
N - Number
T - Type
V - Value
S,U,V etc. - 2nd, 3rd, 4th types

Ahhh I see, thank you so much!

You're welcome! :-)