I wonder why the literal declaration of an object cannot have the name of an object like a function?
Like the general Declaration object: var myobj = {name: "Xiaoming", Age: "18"}, you must create and then assign a value to the myobj variable.
function declaration when var func = function () {}; Looks like an object, this is the creation of an anonymous function.
A function with a name, he has a keyword function to use: function MyFunc () {}; Here the MyFunc is the name of the functions.
So, if you want to have a name, you need to have a keyword that declares it.
But JS doesn't have an object keyword like function. So, the object name "This thing is shattered ~
You must assign a value to refer to.
Other ways of creating objects are the 6 modes of construction, factory, prototype, etc. in advanced design.
Why does the object literal have no name?