+1 vote
in JavaScript by

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> 

 

a) Properties

b) property names

c) property values

d) objects

1 Answer

0 votes
by

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.

Related questions

0 votes
asked Mar 22, 2021 in JavaScript by Robindeniel
0 votes
asked Mar 22, 2021 in JavaScript by Robindeniel
...