JSON Data Types
You are Here:
JSON Data Types
The following are the list of 6 data types supported by JSON.
- String
- Number
- Boolean
- null
- Array
- Object
In the following example, we will have a look at all JSON data types.
Example
HTML Editor
<!DOCTYPE html>
<html lang="en-US">
<body>
<h1>JSON Data Types</h1>
<p id="point"></p>
<button onclick="myFunction()">Click Me</button>
<script>
var x = document.getElementById("point");
var data = [{
"name": "Mike",
"age": 36,
"married": true,
"partner": null,
"children": ["Joe", "Zia"],
"detail": {
"birth": "London",
"hair": "blonde"
}
}]
function myFunction(){
x.innerHTML = data[0].detail.birth;
}
</script>
</body>
</html>
Reminder
Hi Developers, we almost covered 100% of JSON Tutorials with examples for quick and easy learning.
We are working to cover every Single Concept in JSON.
Please do google search for:
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.