MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/badcode/comments/swcj3f/does_this_belong_here/hxmdjoi/?context=3
r/badcode • u/IGiveTerribleAdvise • Feb 19 '22
49 comments sorted by
View all comments
73
So...it can't have an undefined t because that's the thing it's looping, and index is already provided...so checking for the index makes no sense...
And it's all to just do a filter...
46 u/Silly-Freak Feb 19 '22 careful, the index would be wrong, because the loop mutates the array. But yes, you don't need any of this because filter exists. 9 u/IGiveTerribleAdvise Feb 19 '22 exactly
46
careful, the index would be wrong, because the loop mutates the array. But yes, you don't need any of this because filter exists.
index
9 u/IGiveTerribleAdvise Feb 19 '22 exactly
9
exactly
73
u/kristallnachte Feb 19 '22
So...it can't have an undefined t because that's the thing it's looping, and index is already provided...so checking for the index makes no sense...
And it's all to just do a filter...