It is said here:
any quotes inside the JSON have to be
“escaped” with a backslash in front.
Otherwise, JavaScript gets confused
about which quotes we want for display
and which quotes are part of the
programming.
but in their code snippet I can’t see any escaping character is this tutorial buggy I’m confused ? :
var movielisttext = "{"movielist": ["Friday the 13th", "Friday the 13th Part 2", "Friday the 13th Part III", "Friday the 13th: The Final Chapter", "Friday the 13th: A New Beginning"]}";
My question is specifically if their article has an error or not because it amazes me that a tutorial for beginner can embed such error.
What you have is JavaScript, not JSON.
If you want JSON:
If you want a JavaScript object
If you want a JavaScript string containing the JSON:
or
Since the data itself doesn’t include any
"characters, they don’t need to be escaped as far as the JSON is concerned.