-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlesson-6.html
36 lines (33 loc) · 961 Bytes
/
lesson-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
<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>Document</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.1/dist/css/bootstrap.min.css" rel="stylesheet" >
<style>
body{
padding: 20px;
}
</style>
</head>
<body>
<h1>Welcome to Lesson - 6 Objects</h1>
<script>
const obj = {
name: 'Sukumar',
age: 28,
occupation: 'Software',
speak: function() {
return `Mr.${this.name} occupation is ${this.occupation}`;
},
attack: function(sound) {
return `punches bad guy with ${sound}`;
}
}
console.log(obj);
console.log(obj.speak());
console.log(obj.attack('boom'));
</script>
</body>
</html>