Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialNelisa Loreto
5,436 PointsDo json property names really need to be in double quotes? Is this an old requirement?
I'm surprised that property names must be enclosed in double quotes. Assume this question needs updating?
2 Answers
andren
28,558 PointsYes. Properties in JSON have to be strings, and in JSON as string is defined as "a sequence of zero or more Unicode characters, wrapped in double quotes, using backslash escapes". In other words using single quotes, or no quotes at all is not allowed.
I'm not quite sure what is so surprising about it, JSON was made with simplicity in mind, and having strict rules about how it is formatted makes it far simpler to both programmatically create and read it in a consistent manner.
Nelisa Loreto
5,436 PointsThanks, reviewed the video and understand.