Hacker News new | ask | show | jobs
by oblosys 1238 days ago
With these declarations your fragment is valid in both JavaScript and TypeScript:

    class b {}
    class c {}
    const d = JSON.parse
    const a = Promise.prototype.then.bind(Promise.resolve(1))

    console.log(a<b,c>(d))
    // TS output: Promise { <state>: "pending" }
    // JS output: false false
TS playground: https://tsplay.dev/mAdeZN