What's the meaning of this line in object literal notation?


#1



var emptyObj = {};

This is the instruction on how to create an object using literal notation. "Literal notation is just creating an object with curly braces, like this:"
The complete code is:

var myObj = {
    type: 'fancy',
    disposition: 'sunny'
};

var emptyObj = {};

The last line of code seems unnecessary, and I don't understand what it means.


#2

it is there to show you that you can also create empty objects with the literal notation


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.