I was going to store the map as a JSON string in window.localStorage, but I found that I could not convert the map to a JSON string
var map = new Map();
map.set(21,'A');
map.set(22,'B');
console.log(JSON.stringify(map));
ah
Read More:
- JSON and map convert to each other (using fastjson)
- Encapsulation of Ajax JSON / fromdata request in native JS
- SCRIPT1002: syntax error File: 0. chunk.js ,SCRIPT5009: ‘Map‘ is undefined File: 0. chunk.js -Solutions
- [jQuery] jQuery operates on JSON strings or JSON objects
- JS error: unexpected token u in JSON at position 0
- 【ipfs-api】npm ERR! JSON.parse package.json must be actual JSON, not just JavaScript.
- Node.js Medium package.json The difference between devdependences and dependencies
- [leetcode] zigzag transformation
- Map to vector pair map.second sort
- Python json.dumps () json.dump The difference between ()
- Error handling when ABP specifies map object during map operation
- Storing JSON data in session storage
- Easynvr operation log reports an error. Fatal error: concurrent map read and map write troubleshooting
- JSON data format net.sf.json .JSONException: A JSONObject text must begin with ‘{‘ at character 1 of Error:(f…
- Android 9 (P) recovery upgrade Map of ‘@/cache/recovery/block.map’ failed problem analysis guide
- Configuration file for vscode setting.json UI interface or JSON form
- [go] solve the fatal error of go: concurrent map writes map non concurrent security
- Dataframe and np.array The mutual transformation of
- Browser prompt: Source mapping error: request failed with status 404 Source URL: http://xxx.js Source mapping URL: jquery.min.map
- Error reading JSON file: json.decoder.JSONDecodeError : Extra data: line 6 column 2 (char 1329)