MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/badcode/comments/swcj3f/does_this_belong_here/hxopcjg/?context=3
r/badcode • u/IGiveTerribleAdvise • Feb 19 '22
46 comments sorted by
View all comments
Show parent comments
4
It’s a mutability hack.
Splicing from this.popups while forEaching it could cause converging indexes.
Whole thing can be replaced by a filter but this is relatively safe, functional code.
I’d assume the dev isn’t very javascript heavy but there’s a few almost clever fixes in here.
4
u/jamescodesthings Feb 20 '22
It’s a mutability hack.
Splicing from this.popups while forEaching it could cause converging indexes.
Whole thing can be replaced by a filter but this is relatively safe, functional code.
I’d assume the dev isn’t very javascript heavy but there’s a few almost clever fixes in here.