ELI5: Explain Like I'm 5

Nested function

Nested functions are like buildings with floors. A building has a floor on the bottom and more floors stacked on top of it. Each floor has rooms, just like a nested function has different parts. A nested function has a main function (the building) and then can have lots of other functions (the rooms) inside that main function. Just like a building, the rooms in the nested function get smaller as they go up. The reasons people use nested functions is so they can keep their code neat and organized. Also, since the different functions inside the nested functions are related to the main function, it's easy to see and understand what each function is doing.