chrome.storage.local.set({list : 'list1'});
function get_list() {
function x() {
chrome.storage.local.get(['list'], function (res) {
return res.list;
});
}
return x() ;
}
alert(get_list());
I have read this .But I didn't find any solution
It works very well if I don't use chrome.storage.local.get function in another function .I am used to write code in PHP that's why I am a bit confusing .Why it returns undefined ? Is it something they call "callback hell" ? Actually I created x function for returning response but then realized I created one function again ,I need to return nested function answer to function answer and then call it . Thanks in advance