JSON object literal has the following characteristics:
{}
.
{key1:value,key2:value2}
that are separated by a colon :
and key must be a string and always placed inside double quotes and value must be valid JSON data type such as string, number, object, array, boolean, null, etc.
When JSON object literal is surrounded by a single quote then it will be formed JSON string. Whenever a single quote is removed from the JSON string then it can be formed JSON object literal.
Below is an example of a JSON string.
JSON object literal is exist inside JSON string:
Please keep in mind that JSON is a string, not an object.
Javascript object can be created by JSON object literal.
Javascript object is created by parsing JSON string. Let us see it.
Object value can be access though the (.)
operator.
object values can also be access by using bracket ([]) notation.