I am setting chrome.local variables in pop.js but unable to retrieve them in content.js
popup.js
chrome.storage.local.set('TITLE',title);
content.js
var title = null;
    $(".class").each(function () {
          chrome.storage.local.get('TITLE', function (result) {
                                    title = result.TITLE;
                    console.log('inside'+title);//prints value
                                });
    }
  console.log(title);//returns null;
It returns title as null
Chrome Console outputs as:
outside: null
content.js:42 insideJava: A Beginner's Guide, Sixth Edition
 
    