-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdatatypes.js
More file actions
45 lines (33 loc) · 813 Bytes
/
datatypes.js
File metadata and controls
45 lines (33 loc) · 813 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// Primitive data types
// String
let name = "harry";
console.log("My string is " + name);
console.log("Data type is " + (typeof name));
// Numbers
let marks = 34.4;
console.log("Data type is " + (typeof marks));
// Boolean
let isDriver = true;
console.log("Data type is " + (typeof isDriver));
// Null
let nullVar = null;
console.log("Data type is " + (typeof nullVar));
// Undefined
let undef = undefined;
console.log("Data type is " + (typeof undef));
// Reference Data Types
// Arrays
let myarr = [1, 2, 3, 4, false, "string"];
console.log("Data type is " + (typeof myarr));
// Object Literals
let stMarks = {
harry: 89,
Shubham: 36,
Rohan: 34
}
console.log( typeof stMarks);
function findName() {
}
console.log( typeof findName);
let date = new Date();
console.log( typeof date);