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 trialJoylyne Mangezi
2,632 Pointsfunctions and println
functions
func {greeting { println ("Hello")}
2 Answers
Robert Richey
Courses Plus Student 16,352 PointsHi Joylyne,
You're doing great, and your code is really close to working.
It's worth taking another look at the Creating a Function video. Amit does a great job explaining both how to create a function and then how to call it.
Cheers
Bradley Jackson
2,668 PointsYou are extremely close!
To start, I will just let you know the syntax of a function in swift to start.
//EXAMPLE OF A FUNCTION
func functionName() {
// Whatever the function does
}
Obviously, you'd use a different name for the function. Now really think about how you would build it for the code challenge before you read the answer below...
//ANSWER
func greeting() {
println("Hello")
}