What's the point of the function end) or end?

I’ll mark myself as a solution as a signal I’m marking everyone as a solution. Thank you so much!