Lua return

For some reason, I just can’t grasp what exactly return does and the proper places to use it.

return ends the function by returning a value.

[lua]local function PlayerName(ply) – This function returns the name of the player that is passed as an argument.
return ply:Nick()
end

print(PlayerName(LocalPlayer())

local function FancyPrint(str)
if not ( str or (type(str) == “string”) ) then
print(“Please input a valid string!”)
return – Here return is just used to terminate the function.
end
print(str)
end[/lua]

[del]Do you need return to terminate a function?[/del]

Oh never mind, I see how that second part works.