Ad
  • Custom User Avatar

    Hi @bridgecoder.

    why does it work without using "func great"

    In my code great is of type (String,String) -> String, which basically says this is a closure that expects two String values as parameter and returns another String value. And a closure is basically the same thing as a function.

    and that $0 == $1 part too?

    In a closure you can access the input parameters using $-Syntax, e.g. $0 is the first parameter, $1 the second, etc.
    Hope that helps.

  • Custom User Avatar

    hey brother, Im new to Swift, could you pls expain me your code? like why does it work without using "func great" and that $0 == $1 part too?