You will need to understand the difference between synchronous and asynchronous behaviour, I have a video on that for Ionic which may help: https://www.youtube.com/watch?v=vrjsQDZuhLk
What you are describing is synchronous code, lines will execute one after the other. Some code executes asynchronously, like calls to a server or fetching something from storage, and it will be run at some point after the rest of your synchronous code has run. You definitely do not want to force everything to happen synchronously in your application, you just need to understand what asynchronous code is and then how to handle that in your application.
Same problem,
So still I don’t know how I can fix this problem, I checked all what I know and put the set function in several places but still the application start with get function
It is asynchronous code. You work around its schedule, not your schedule.
Therefore, you must wait until the code is guaranteed to be finished. Which is the good news! It will eventually let you know that it is done, and safe to continue doing stuff. In particular, this.storage.set returns a Promise, which is a type of future, which for our discussion merely means that it will execute its code, and it will return at some point in the future. Perhaps it will be 5 seconds from now, but maybe it’ll be a minute or two. However, it will finish and let you know…it promises!
With all that in mind, your example code will need to look something like this: