-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdatatypes.js
More file actions
77 lines (64 loc) · 1.33 KB
/
Copy pathdatatypes.js
File metadata and controls
77 lines (64 loc) · 1.33 KB
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
// alert("hello jsclass");
console.log("welcome to my website");
//var
//let
//const
var name ="raph";
console.log(name)
let age = 40;
age = 90;
console.log(age);
const email = "taylorjacobs@yahoo.com";
console.log(email);
// datatypes which include; primitive and non-primitive datatype
// Primitive
// String
let name2 = "simon";
// number
// integer
let age2 = 25
//float
let myNumber = 0.94
// boolean has to do with True or False
let isMarried = false;
console.log(isMarried);
let isGudman = true;
// undefined
let notAssigned;
// null
let isActive = null;
isActive = "fufu";
console.log(isActive);
// Non-primitive
// Array
let products = ["bag", "shoes", "cloth", "phone" , "laptop"];
console.log(products[3] [0]);
// Object
let user = {
name: "raph",
age: 205,
email: "taylorjacobs@gmail.com",
isStudent: false
};
console.log(user)
const user2 = {
id: 1,
firstName: "Taylor",
lastName: "Jacobs",
username: "tjacobs",
email: "taylorjacobs@gmail.com",
password: "Password1234",
phone: "+1234567890",
address: {
street: "123 Main Str",
city: "Lagos",
state: "Lagos",
postalcode: "1000001",
country: "Nigeria",
},
dateOfBirth: "1995-08-07",
isActive: true,
roles: ["user", "admin"],
lastLogin: "2024-10-14T10:35:00Z"
};
console.log(user2);