![GitHub diff of a JavaScript file moving a function out of a function.](https://mattifesto.com/data/cb/d5/b293b809bf8011a44a9312f89d3ec837e00c/rl2560.png)
My video about placing a well formatted and white spaced function inside Array.forEach() generated a lot of discussion on TikTok.
Before most of that discussion I was also adjusting my feelings. Functions should be short. So having an entire function inside of another function is causing a readability problem for the containing function. So I decided to move the function out.
However, I still feel that if you have to have a function inside a function it should be fully formatted, commented, and white spaced. However, how often is that really necessary. Move the functions outside the containing function.