JSON Objects

Single Object

In the following example, we will have a single object in a variable.

Example

HTML Editor
[ { "name": "Mike", "age": 36 } ]

Multiple Objects

In the following example, we will have multiple objects in a variable.

HTML Editor
[ { "name": "Mike", "age": 36 }, { "name": "Alex", "age": 30 } ]

Object within Object

In the following example, we will have object within object.

Example

HTML Editor
[ { "name": "Mike", "age": 36, "id": { "eyes": "brown", "hair": "blonde" } }, { "name": "Alex", "age": 30, "id": { "eyes": "blue", "hair": "brunette" } } ]

Join Our Channel

Join our telegram channel to get an instant update on depreciation and new features on HTML, CSS, JavaScript, jQuery, Node.js, PHP and Python.

This channel is primarily useful for Full Stack Web Developer.

Share this Page

Meet the Author