M

Mr. Dubey • 52.26K Points
Coach

Q. Consider the following code snippet :
var book = {
    "main title": "JavaScript", 
    'sub-title': "The Definitive Guide", 
    "for": "all audiences", 
    author: { 
      firstname: "David", 
      surname: "Flanagan" 
    }
  };
In the above snippet, firstname and surname are

  • (A) properties
  • (B) property values
  • (C) property names
  • (D) objects

Explanation by: Mr. Dubey
firstname and surname are the property names. The value of that particular property is itself an object. That is why these property names are unquoted.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.