var arr= new Array();
arr.push("John");
localStorage["name"] = JSON.stringify(arr);
How to check if John existed in the localstorage? What to do next after I got the values?
JSON.parse(localStorage["name"]);
return-false-if-array-exist-in-localstorage
JSON.parse(localStorage["name"]).indexOf("John") !== -1 ? false : true;
この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。
侵害の場合は、連絡してください[email protected]
コメントを追加