What could be causing the failure of JSON.parse
to parse the JSON string provided below?
Is the JSON syntax incorrect?
Interestingly, even though its custom JSON parser throws the same error as JSON.parse
, https://jsonlint.com/ validates this string.
JSON string
{
"Search results: \":s\"": ""
}
Code
let test = `{
"Search results: \":s\"": ""
}`
JSON.parse(test);
Result
VM1882:2 Uncaught SyntaxError: Unexpected token s in JSON at position 22 at JSON.parse () at :1:6