func greet(person: String) -> String {
let greeting = "Hello, " + person + "!"
return greeting
}
//function trying to be called
func aFunction() {
print("called function")
}
//call function like this
aFunction()
func greet() {
print("Hello World!")
}
func functionName(parameters)-> returnType {
// function body
}
// declare a function
func greet() {
print("Hello World!")
}
// call the function
greet()
print("Outside function")