Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
...and forEach being synchronous makes sense it that doesn't wait for an async call. So nothing wrong here.
-
sariel84473yWhy the fuck are there two ways to loop through an array?
It's like PHP all over again! -
@sariel there are more than two ways to loop through an array… also you can do fucked up black magic to the array you are looping through. You won’t believe the shit I’ve seen…
-
0x41392783y@rantsauce can you elaborate why it makes sense? I mean for me it doesn’t, i would expect that if the default behavior is sync, passing an async function it will await it, not change it’s behavior to async
-
Of all the language based gotchas, Javascript has the fucking worst (and it’s not those so called gotchas that involve type coercion bc that’s just lack of language fundamentals)
-
macfanpl1023y@iiii why we should avoid using mdn? Is the reason that it was created by Mozilla not good enough? For me it is.
Someone not long ago called Mozilla “internet villain”. I fully agree with this statement.
TL;DR: don’t use Array.forEach use
for … of … instead.
Array.forEach is synchronous, but pass it an async function and the bastard does not await it.
I was so sure that it was sync….
Wasted 2h
devrant
unexpected
hell
javascript