Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3360796
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T03:02:46+00:00 2026-05-18T03:02:46+00:00

According to Crockford’s json.org , a JSON object is made up of members ,

  • 0

According to Crockford’s json.org, a JSON object is made up of members, which is made up of pairs.

Every pair is made of a string and a value, with a string being defined as:

A string is a sequence of zero or more
Unicode characters, wrapped in double
quotes, using backslash escapes. A
character is represented as a single
character string. A string is very
much like a C or Java string.

But in practice most programmers don’t even know that a JSON key should be surrounded by double quotes, because most browsers don’t require the use of double quotes.

Does it make any sense to bother surrounding your JSON in double quotes?

Valid Example:

{
  "keyName" : 34
}

As opposed to the invalid:

{
   keyName : 34
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T03:02:47+00:00Added an answer on May 18, 2026 at 3:02 am

    The real reason about why JSON keys should be in quotes, relies in the semantics of Identifiers of ECMAScript 3.

    Reserved words cannot be used as property names in Object Literals without quotes, for example:

    ({function: 0}) // SyntaxError
    ({if: 0}) // SyntaxError
    ({true: 0}) // SyntaxError
    // etc...
    

    While if you use quotes the property names are valid:

    ({"function": 0}) // Ok
    ({"if": 0}) // Ok
    ({"true": 0}) // Ok
    

    The own Crockford explains it in this talk, they wanted to keep the JSON standard simple, and they wouldn’t like to have all those semantic restrictions on it:

    ….

    That was when we discovered the
    unquoted name problem. It turns out
    ECMA Script 3 has a whack reserved
    word policy. Reserved words must be
    quoted in the key position, which is
    really a nuisance. When I got around
    to formulizing this into a standard, I
    didn’t want to have to put all of the
    reserved words in the standard,
    because it would look really stupid.

    At the time, I was trying to convince
    people: yeah, you can write
    applications in JavaScript, it’s
    actually going to work and it’s a good
    language. I didn’t want to say, then,
    at the same time: and look at this
    really stupid thing they did! So I
    decided, instead, let’s just quote the
    keys.
    That way, we don’t have to tell
    anybody about how whack it is.

    That’s why, to this day, keys are quoted in
    JSON.

    …

    The ECMAScript 5th Edition Standard fixes this, now in an ES5 implementation, even reserved words can be used without quotes, in both, Object literals and member access (obj.function Ok in ES5).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

According to MDN ( https://developer.mozilla.org/en-US/docs/DOM/CSSStyleRule ) The CSSStyleRule object's style property is read-only. Is
According this article , generic JPA DAO(Data Access Object) is a pretty nice pattern.
According to this link, now we can use Request.Unvalidated to access a raw value
According to a specific row value (Type), I must use a TextBox or a
According to Wikipedia, an embarrassingly parallel problem is one for which little or no
According to MSDN on DateTime.ToString ToString(s) should always return string in the format of
According to https://issues.sonatype.org/browse/OSSRH-3293 Maven m2e Code-Style and Save-Actions connector This plugin is executed inside
According to my previous question integration of jsf2.0 and spring 3.1 and hibernate 4.1
According to the C++11 standard, is the following program well-formed and portable C++? int
According to this SO post: How to check the TEMPLATE_DEBUG flag in a django

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.