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 trialMartin Franzner
3,300 Pointsreturn statement
Someone could please tell me whats going wrong? Ive done exactly like in the video, but was with an Int, maybe my problem is in the String part, I don
t know, if anyone could help me, I would extremely appreciate...
func greeting(person: String) -> String {
return person
}
let greet = person("Tom")
println("Hello \(greet)")
2 Answers
Damien Watson
27,419 PointsHey Martin,
The "Hello" needs to be in the return String, you can cut out storing and printing it. So:
func greeting(person: String) -> String {
return("Hello \(person)")
}
Martin Franzner
3,300 PointsOh, now makes total sense! Thank you Damien!