Why would the variable 'display' here go out of scope and how can I fix it? It prints the proper value within the .then, but as soon as I get to the console log, it is undefined. Is there a way to store the value I get from that promise so I can access it later?
let display;
const user = firebase.getCurrentUser()
.then(values => {
console.log("values:",values['email']);
display = values['email'];
return display;
})
console.log("Display is", display);