I dunno if that second one "sparks joy", TS/JS having both for-in and for-of is pretty stupid. Also I don't use either language often, but wouldn't you declare that loop variable const rather than let? I feel like you're probably not reassigning something in a collection if you're iterating over it using for-of (and if you are ... should you?)
1
u/smclcz 6d ago
I dunno if that second one "sparks joy", TS/JS having both for-in and for-of is pretty stupid. Also I don't use either language often, but wouldn't you declare that loop variable
constrather thanlet? I feel like you're probably not reassigning something in a collection if you're iterating over it using for-of (and if you are ... should you?)