In general, the problem is: I get an array from localStorage , output it, and double quotes in which the array elements are framed are automatically escaped, how to remove it?
localStorage.setItem('idsGTag', JSON.parse(idsGTag)); localStorage.setItem('totalGTag', JSON.stringify(totalGTag)); var idsGTag = localStorage.getItem('idsGTag'); var totalGTag = localStorage.getItem('totalGTag');
I have an Uncaught SyntaxError error: Unexpected token u in JSON at position 0. But if I just get the variables from the repository and output to the console, then everything is ok. I intentionally use parse and stringify to see the result of both
JSON.parse
- Grundy