Is the declaration of a function in the for loop an anti-pattern, leading to some real negative consequences?
function foo(x) { //много кода, где bar не используется for (let i = 0; i < x; i++) { (function() { function bar() { //код bar } bar(); })(); } //много кода, где bar не используется }