How do you evaporate localStorage with JSON.parse?



  • How do you evaporate? "sdasd, dsada, dasdas, dasdas" in such a way ["sdasd", "dsada", "dasdas", "dasdas"]
    In JSON.parse makes a mistake:

    JSON.parse: unexpected character at line 1 column 1 of the JSON data... ♪



  • You don't have a line in JSON format, that's a mistake.

    The solution is:

    var str = "sdasd, dsada, dasdas, dasdas";
    var array = str.split(", ");
    

Log in to reply
 


Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2