Init data type sample

This commit is contained in:
2023-08-07 16:45:01 +07:00
parent 252315cbc2
commit ccafdecc10
2 changed files with 45 additions and 0 deletions
+12
View File
@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Javascript Training</title>
</head>
<body>
<h1>Javascript Training</h1>
<script src="./index.js"></script>
</body>
</html>
+33
View File
@@ -0,0 +1,33 @@
// Data Types
let isBoolean = true;
console.log(isBoolean);
// console.log(typeof false);
console.log(typeof isBoolean);
// console.log(typeof 18);
// console.log(typeof 'String text');
isBoolean = "String text";
console.log(typeof isBoolean);
let number = 18;
console.log(number);
console.log(typeof number);
number = 27;
console.log(typeof number);
console.log(typeof null);
// let, const and var
let day = 30;
day = 31;
const birthYear = 2001;
// birthYear = 1990;
var myJob = "Student";
myJob = "Grab bike";
lastName = "Nezumi";
console.log(lastName);