如果关闭应用程序,PhoneGap 应用程序中分配给 JavaScript 变量的内存是否超出范围?

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

例如,如果我声明:

var x = … // get result from some API

我下次打开应用程序时是否可以使用此结果,还是应该将其存储在设备本地?

Phonegap 变量存储不是持久的。如果需要储值,可以考虑使用localStorage或者数据库