In regards to storage, the function is returning a null value outside of the function. Below is the code snippet:
username:any;
this.storage.get('user').then((value) => {
this.username = value;
});
console.log(this.username);
Output: undefined;