chrome.storage.local.get() を使用して Chrome ストレージから値を取得します。この値を関数で使用できるようにする必要があります。
私が本当にやりたいことは、get 関数の外で the_userid にアクセスすることですが、うまくいきません。
function my_f(userid){
  alert("I'm called");
}
var the_userid;
chrome.storage.local.get('userid', function (result) {
    the_userid = userid.result;
 }
my_f(the_user_id);
したがって、関数 my_f を渡すとうまくいくと考えました。
function my_f(userid){
  alert("I'm called");
}
chrome.storage.local.get('userid', function (result, my_f) {
    var the_userid = userid.result;
    my_f(the_user_id);
 }
しかし、 my_f は呼び出されません。
何をすべきか?