TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
async
is in my code
async
, but nope: async
is there
(await 1)
is an expression of type Promise<number>
takesNumberOnly
would not work
await
in the inner fn
1
in a promise and then unwraps it
Without await
, promises in for loops would be a hassle, especially if each iteration depends on the previous iteration (so no Promise.all()
)
I think you have to actually use a recursive function for the loop if you can't use await
.
Memory is rusty and I'm too lazy to try it out
.then()
it’s just one step above callback hell
.then
await
does something like Promise.then(x => currentGenerator.next(x)); yield;
instanceof
obj instanceof B
doesn't imply obj instanceof C
at runtime