I have this Function , Node js
- function get_type(msg){
- try {
- const tok = "xxxxxxx" ;
- const uri = 'https://api.wit.ai/message?v=20200513&q=' + msg;
- const auth = 'Bearer ' + tok;
- fetch(uri, {headers: {Authorization: auth}})
- .then(res => res.json())
- .then(res => console.log(res ))
- } catch (error){
- }
-
- }
- });
I need return Fetch response inside a variable to use it on other function
how i can do that