I'm not even sure what you're talking about. Is this a JavaScript complaint and they were meant to use a for..of? Are you an FP purist and think they were supposed to use map/filter?
This sounds like you have some very specific trauma around a very specific "foreach if loop", because I would personally never throw around such a specific-but-not-specific example of tech debt. Tech debt is extremely contextual.
Now your left with a code base forever with tech debt because of a hacky foreach if loop.
You're telling me you've never worked with anyone who does half arsed work? Where you need to pick up their slack? Lucky you.
Because if you can't do a proper job at least on elementary level then what do you do then when they refuse to fix their mess?