Declare a function with arguments

 Problem

I want to declare a new function, which takes some arguments, and then call it.



 Recipe


// Declare our new function
func sayHelloTo(name:String) {
    print("Hello \(name)!")
}

// Call it
sayHelloTo("John")


				


 Playground