我试图将JSON值一个接一个地推送到localstorage中,但是我得到了重复且未定义的值
this.offlineArray.push(postData[0]);
let checkLocData = localStorage.getItem("dataremove");
if(!checkLocData) {
localStorage.setItem("dataremove",JSON.stringfy(this.offlineArray));
this.offlineArray = [];
} else {
let locarray = JSON.parse(checkLocData);
this.offlineArray.push(locarray[0]);
localStorage.setItem("dataremove", JSON.stringify(this.offlineArray))
this.offlineArray = [];
}