What will be the output of the following JavaScript code?
<script> var article = { "main title": "How to learn JavaScript", 'sub-title': "The Definitive Guide", "for": "all audiences", author: { firstname: "Scott", surname: "McCall" } } </script>
<script>
var article = {
"main title": "How to learn JavaScript",
'sub-title': "The Definitive Guide",
"for": "all audiences",
author: {
firstname: "Scott",
surname: "McCall"
}
</script>
a) Properties
b) property names
c) property values
d) objects
Answer: B
Reason: In the above-given code, a nested object (an object inside in the other object) is used, and "firstname","lastname" are the properties. The value of that individual property is itself an object.