5 ms·
I'm not aware of any programming language where it is safe to use a function's return value without knowing what the return value is. This seems unrelated to as
by Touche 9y ago
I'm not aware of any programming language where it is safe to use a function's return value without knowing what the return value is. This seems unrelated to async/await, if you are calling functions that are returning things other than what you expect, you are pretty much screwed.
- xfer 9y agoNo in typed language, this is not a problem because the compiler will refuse to compile. For uni-typed languages async/await is not the right model imho.
- Touche 9y agoAgain, this is unrelated to async/await. Normal functions might return a number or an object or undefined or whatever. Since JavaScript is a dynamic language it is unsafe to call a function without either 1) Trusting that the function returns what its API says it should return or 2) Checking the return type and acting appropriately. So, the grandparent's complaint is about JavaScript being a dynamic language, async/await doesn't fix this issue or make it any worse.
- singularity2001 9y agograndpa here. position accepted.