How to return return from a promise callback with fetch? [duplicate]
问题 This question already has answers here : How do I return the response from an asynchronous call? (36 answers) Closed 2 years ago . I'm a bit stumped. I've forgotten how to do this. I have a function called ext.get() that takes a parameter of url. It fetches a response from the url. The ext.get() function is meant to return the response as a json. I don't think it is doing that. ext.get = (url) => { let myHeaders = new Headers(); let options = { method: 'GET', headers: myHeaders, mode: 'cors'