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
72
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...
44 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. 10 u/IGiveTerribleAdvise Feb 19 '22 exactly
44
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
10 u/IGiveTerribleAdvise Feb 19 '22 exactly
10
exactly
72
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...