Register Now

Login

Lost Password

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

What will be the firstname and surname of the following JavaScript code?
var book = {
“main title”: “JavaScript”,
‘sub-title’: “The Definitive Guide”,
“for”: “all audiences”,
author: {
firstname: “David”,
surname: “Flanagan”
}
};

What will be the firstname and surname of the following JavaScript code?
var book = {
“main title”: “JavaScript”,
‘sub-title’: “The Definitive Guide”,
“for”: “all audiences”,
author: {
firstname: “David”,
surname: “Flanagan”
}
};
a) properties
b) property values
c) property names
d) objects

Answer: c
Explanation: The above code snippet contains an object inside another object. firstname and surname are the property names. The value of that particular property is itself an object.

Join The Discussion