Goal: I want to collect the return value of a function.
Question: How can I call the 'test' function to collect the return variable 'name' without passing through a parameter?
Is there a way to collect a variable(values) from functions with agruments(parameters) without passing through a parameter?
I have provided an example:
let userName = "Jake"
let userInfo = test(name: userName)
func test(name: String) -> String {
return name
}
// function call
// Goal: I want to retrieve the function return value without passing a parameter
let newUser = test()
Does the function 'test' return value have to be stored to retrieve it? I want to retrieve the 'userName' Jake