Why the plugin chrome returns undefined?

function show(){
 return chrome.storage.sync.get('AWSAccessKeyId',function(result){
 return result.AWSAccessKeyId;

var item = show();

returns undefined
July 8th 19 at 16:28
1 answer
July 8th 19 at 16:30
getAWSAccessKeyId function() {
 return new Promise(function (resolve, reject) {
 chrome.storage.sync.get('AWSAccessKeyId', function (result) {


getAWSAccessKeyId function(cb){
 chrome.storage.sync.get('AWSAccessKeyId', function () {


Async function ...blah-blah-blah... at the time the return result is not yet known ...blah-blah-blah... use colbecki or promises ...blah-blah-blah... read learn.javascript.ru...

PS Today seems to be the first to ask a question about async in js
P. P. S. does anyone have a link to reference the answer to this question? Throw in comments to same not to write every time.
and you don't know whether it is possible to set the time of your life? - jabari_Bayer91 commented on July 8th 19 at 16:33
https://developer.chrome.com/extensions/storage - aniya commented on July 8th 19 at 16:36

Find more questions by tags JavaScript