Passing function to variables (swift)

The following function is returning another function as its result which can be later assigned to a variable and called.

function jediTrainer takes 0 arguments. It returns a function that (takes in a String and an Int, and returns a String)