-
Notifications
You must be signed in to change notification settings - Fork 0
/
Task 6.html
43 lines (39 loc) · 1.18 KB
/
Task 6.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title> Task 6 </title>
</head>
<body>
<h2> Class </h2>
<script>
// Create a class "person", it holds all details
class Person {
constructor(name, id, age, location, mobile)
{
this.name = name;
this.id = id;
this.age = age;
this.location = location;
this.mobile = mobile;
}
}
let details = new Person("Sumaiya", 23101, 25, "THJ", 9876543210);
console.log(details);
// Create uber class calculate price
// class Uber {
// constructor(normalRent, distance, waitingCharge, traffic)
// {
// this.normalRent = normalRent;
// this.distance = distance;
// this.waitingCharge = waitingCharge;
// this.traffic = traffic;
// }
// }
// let price = new Uber(100, 50, 50, 20);
// console.log(price);
</script>
</body>
</html>