Search code examples
javascriptlocal-storagephonegapapache-cordova

Does memory allocated to JavaScript variables in a PhoneGap app go out of scope if the app is closed?


For example if I declare:

var x = … // get result from some API

Will this result be available for use the next time I open the app or should I store it locally on the device ?


Solution

  • Phonegap variable storage is not persistent. If you need to store value, consider using localStorage or a database