I need to get a local storage value outside the call, to use it in another function, I see this is an async function and outside log gets called first, but cant rly wrap how it works and why I get the value on the second call, but not it the first call. So the question is how do I get the value outside the call and make First Call work as second call ?
var Credentials = []
chrome.storage.local.get(["Key"], function(result) {
const o = result.Key.email
console.log("this is email", result.key.email)
Credentials.push({"email": result.key.email})
console.log("Second Call",Credentials[0].email)
});
console.log("First Call",Credentials[0])