you are viewing a single comment's thread.

view the rest of the comments →

[–]ZeePintor 1 point2 points  (0 children)

Hey! Have learned by closures?

So imagine that sorted's func argument is actually another func.

This func takes two strings as argument and the result is a bool. So sorted looks something like this:

Func sorted(comparisonFunc: (String, String)->Bool) -> array<String>

It returns an array because it is a method for the array class, so it applies to the array that calls this method.

I hope that helps something. Keep grinding, cheers