Good day,
How can I make a variable in callback be globe to other functions in JS. Example I want the below function to return the value of myvariable but i will call it like let text = function_name(item)
let function_name = function(item) {
frappe.call({
method: "location here",
callback: function(r) {
var myvariable = "text";
return myvariable;
}
});
}