Samuel
@samuel.fm
javascript confession: I try and use `in` every time, before remembering it’s `of`
15 8 142
Fran C Brusa
This helps me remember: -In for Objects -Of for Iterators (I4O, O4I) You have to invert the initial letter. It’s still confusing but it helps once you remember it
1 14
ponder
best to desugar all your loops into explicit gotos for exactly that reason. straightforward, declarative, readable
2
esmevane, sorry
even now, looking at this, knowing you prefer one, and knowing it's probably the one i prefer, i can't remember which is which
warpfork
I learned this for the first time, and the hard way, about a week ago. Would say it cost me at least a week of insanity and going down other wrong paths before I even realized both constructs exist. 🤦
1
warpfork
(I started using the forEach methods on Map, which dodges the issue........ Right up until you need to do an async thing in the callback. Then... Then you're just hosed, afaict. I finally found the "of" construct by sheer accident, after ripping out hair wondering where asyncForEach was... 🫠)
m0n90053 🦋
I can't advise you concerning your js syntax, but in English that would be 'to', not 'and'. If I'm niggling, fine, but it gets me not quite as much as when people say 'less' for 'fewer'.
1