FIX JSON.parse unexpected token, use this function when having a valid JSON but getting an [Unexpected Token]
function escapeSpecialChars(jsonString) {
return jsonString.replace(/\n/g, "\\n")
.replace(/\r/g, "\\r")
.replace(/\t/g, "\\t")
.replace(/\f/g, "\\f");
}