Answer the question
In order to leave comments, you need to log in
How to make a return to an external function in JS?
Good evening.
I get a callback function and I need to display the result in the storage() function.
function storage(name) {
// ...
self.port.on("localeEmit", function(title) {
return title;
});
// ...
}
storage("title");
Answer the question
In order to leave comments, you need to log in
function storage(name, callback) {
// ...
self.port.on("localeEmit", function(title) {
callback(title);
});
// ...
}
storage("title", function(title) {
//...
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question