News Score: Score the News, Sort the News, Rewrite the Headlines

Javascript await was rogue all along

Don’t tell me you don’t know await is rogue too, jess christ. Tell me what is going here. (async () => { const x = await { then: (f) => f(4 + 2) }; console.log(x); // 6 })(); Example by Thomas Right there is a thenable, a big time Javascript interface implemented in .then callback chaining. Or as MKRhere like to put it “An object that exposes a then method is a Thenable” Now let’s explore some more interesting things. Let’s quickly reiterate on a fundamental definition. A Thenable is simply an o...

Read more at codedynasty.dev

© News Score  score the news, sort the news, rewrite the headlines