Here is my TypeScript snippet:
async function get_string(){
return "hello"
}
var the_string = get_string()
In the code, the type of the_string
is Promise<string>
I am interested in removing the Promise
from the type of the_string
and making it just string
. I believe this can be achieved using the generics feature of TypeScript.
Edit: This task has a practical application for me. I am currently developing a JavaScript interpreter that handles promise resolutions automatically.