我有一些值动态存储在 localStorage 中,其递增值如下:localStorage["Value0"], localStorage["Value1"],....
当我尝试像这样访问它们时:
JavaScript:
localStorage["Counter"]=0;
var i = localStorage["Counter"];
var d =localStorage["Value"+i];
i = i + 1; // i becomes "01"
var f = localStorage["Value"+i];
i 的值是“01”而不是 1 ...有没有办法正确增加 i 的值?