C++ has the decltype
keyword that allows getting the return type of a function without evaluating it, and I was wondering if the typed dialects of JS had something similar. I would imagine it working somewhat like this:
let foo = () => 'bar'
let baz: typeof foo() // uses the inferred return type of foo()
Aucun commentaire:
Enregistrer un commentaire