←back to thread

320 points willm | 2 comments | | HN request time: 0s | source
Show context
throwawayffffas ◴[] No.45109435[source]
The function coloring is a non starter for me.

I would just rather write JS where everything is async by default.

replies(1): >>45109493 #
IshKebab ◴[] No.45109493[source]
Everything is not async by default in JS.
replies(2): >>45109573 #>>45110137 #
1. fzzzy ◴[] No.45110137[source]
I think what they mean is that there are no blocking functions in the standard library except alert, prompt, and confirm. ( are there any others?)
replies(1): >>45112808 #
2. steve_adams_86 ◴[] No.45112808[source]
Yeah, you can call async functions without specifying it as such and the script will just carry on regardless of how you're handling it. Totally weird, but also pretty cool. When I first started some 20 years ago that was a major foot gun for me, coming from PHP where functions always returned before the next one was called.