Data Types tutorial in JavaScript
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Data Types JavaScript</title>
<script>
var x = "Hello World";
var y = 34.87;
var z = true;
var a = undefined;
var b;
var c = ["HTML", "CSS", "JavaScript"];
var d = {
"name": "Hello World",
"country": "India",
"nationality": "Indian"
};
var e = "55";
document.write(x);
document.write("<br>");
document.write(typeof x);
document.write("<br>");
document.write(y);
document.write("<br>");
document.write(typeof y);
document.write("<br>");
document.write(z);
document.write("<br>");
document.write(typeof z);
document.write("<br>");
document.write(a);
document.write("<br>");
document.write(typeof a);
document.write("<br>");
document.write(b);
document.write("<br>");
document.write(typeof b);
document.write("<br>");
document.write(c);
document.write("<br>");
document.write(typeof c); //In JavaScript, data type will be considered as object for object and array
document.write("<br>");
document.write(d);
document.write("<br>");
document.write(typeof d);
document.write("<br>");
document.write(e);
document.write("<br>");
document.write(typeof e);
</script>
</head>
<body>
<h1>Data Types JavaScript</h1>
</body>
</html>
.png)
.png)
.png)
Comments
Post a Comment