How to make a variable globe in callback

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;
        }
    });
}

Try async: false

let function_name = function(item) {
    var myvariable;
    frappe.call({
        method: "location here",
        async: false,
        callback: function(r) {
            myvariable = "text";
        }
    });
    return myvariable;
}

Thank you, using async: false, helpt