Sorry if I've got this wrong, but wouldn't the first example behave the same way in Javascript as well? The function parent() "awaits" the completion of child(), so it wouldn't be possible to interleave the print statements.
The example from this StackOverflow question might be a better demonstration: https://stackoverflow.com/q/63455683