思路
1、获取key值cxxx和对应的value值
2、去掉c,获取数值
3、根据key获取到的数值把对应的value值放入数组中(把字符串转换为整数,parseInt(value,进制);)
var str = {"c4":564,"c6":14,"c7":1,"c1":573};
var localStorage=[];
for(var key in str){
localStorage[parseInt(key.replace('c',''),10)]=parseInt(str[key],10);
}
var str="{"c4":564,"c6":14,"c7":1,"c1":573}";
var json=eval(str);
json.c4 取值