M

Mr. Dubey • 97.30K 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
  • Correct Answer - Option(C)
  • Views: 72
  • Filed under category JavaScript

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.


Question analytics