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 3236526
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T17:37:56+00:00 2026-05-17T17:37:56+00:00

I am new to JSON and JavaScript objects. Can someone please explain the differences

  • 0

I am new to JSON and JavaScript objects.

  • Can someone please explain the differences between JSON and JavaScript object?
  • What are their uses?
  • Is one better than the other? Or does it depend on the situation?
  • When to use which one, in what situation?
  • Why was JSON created in the first place? What was its main purpose?
  • Can someone give examples of when one should use JSON rather than a JavaScript object and vice versa?
  • 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-17T17:37:56+00:00Added an answer on May 17, 2026 at 5:37 pm

    First you should know what JSON is:

    • It is language agnostic data-interchange format.

    The syntax of JSON was inspired by the JavaScript Object Literal notation, but there are differences between them.

    For example, in JSON all keys must be quoted, while in object literals this is not necessary:

    // JSON:
    { "foo": "bar" }
    
    // Object literal:
    var o = { foo: "bar" };
    

    The quotes are mandatory on JSON because in JavaScript (more exactly in ECMAScript 3rd. Edition), the usage of reserved words as property names is disallowed, for example:

    var o = { if: "foo" }; // SyntaxError in ES3
    

    While, using a string literal as a property name (quoting the property name) gives no problems:

    var o = { "if": "foo" }; 
    

    So for “compatibility” (and easy eval’ing maybe?) the quotes are mandatory.

    The data types in JSON are also restricted to the following values:

    • string
    • number
    • object
    • array
    • A literal as:
      • true
      • false
      • null

    The grammar of Strings changes. They have to be delimited by double quotes, while in JavaScript, you can use single or double quotes interchangeably.

    // Invalid JSON:
    { "foo": 'bar' }
    

    The accepted JSON grammar of Numbers also changes, in JavaScript you can use Hexadecimal Literals, for example 0xFF, or (the infamous) Octal Literals e.g. 010. In JSON you can use only Decimal Literals.

    // Invalid JSON:
    { "foo": 0xFF }
    

    There are some buggy implementations (Firefox 3.5+, IE8+, json2.js) where octal literals are wrongly allowed, e.g. JSON.parse('01') should produce a SyntaxError.

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

Sidebar

Related Questions

I'm still pretty new to JSON and GWT and I'm trying to figure out
New class is a subclass of the original object It needs to be php4
New to javascript/jquery and having a hard time with using this or $(this) to
New to WCF, but familiar with COM+ - can I wrap a WCF service
I'm trying to pass a JavaScript object to a PHP script through jquery.ajax() ,
I need to get the JSON object data out of the callback function so
We just started a new ASP.Net project that uses web services to serialize some
New to xml. Looking for XPath to search a xml file with python ElementTree
New to silverlight. Traditionally if I were to design a wizard-like process where a
New to both Ruby and Rails but I'm book educated by now (which apparently

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.