In this post, we will learn more about this issue and also a way out.
How to fix the “Uncaught SyntaxError: Unexpected token o in JSON at position 1”?
This code will throw the Uncaught Syntax error.
Use the JSON.stringify() method to remove the error. This will convert the data into a string before parsing it.
var string1 = JSON.stringify(data); var parsed = JSON.parse(string1);