Forum Discussion

jfpelletier's avatar
jfpelletier
Contributor
10 months ago
Solved

Converting a string to JSON doesn't work

Hello all, I'm trying to convert a string to a JSON structure, but I'm not succeeding because the format is wrong. The JSON.parse() method says that it's not valid format for a JSON. Here is the st...
  • ptaylor's avatar
    10 months ago

    That's the only way since your string is definitely not valid JSON. You need it to look like this:

    {"language": "Tamil", "taskId": 123}