Although they look similar, it is often a mistake to think that it is the same.
Let's look at the example below.
Over the years, the data has been transmitted via the Internet in a variety of ways. The most popular of them in recent years has been XML.
It looks as this.
The most important criterion for sending data is speed.
When we want to send firstName value using XML, we're also sending property's name. And we do it twice: <firstName> and </ firstName>.
To save the above example in the JSON format, we would do it this way.
It is worth remembering that each Object Literal Syntax is a valid JSON, but not every JSON is a valid Object Literal Syntax.
The above example is a valid Object Literal Syntax, but if we would like it to be valid as JSON we would have to wrap it in quotes.
Therefore, in the example above, only the first console.log will be valid. The second one, without a wrapper in quotes, will end with error.
I will talk about Functions. And why Functions are Objects