parent
5176d7c514
commit
4207b5d30d
@ -0,0 +1,11 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>Object exercises</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<script src="object.js"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
@ -0,0 +1,18 @@
|
|||||||
|
console.log('OBJECT LİTERALS');
|
||||||
|
|
||||||
|
const dog = {
|
||||||
|
name:'Lessie',
|
||||||
|
color:'Brown',
|
||||||
|
legs: '4',
|
||||||
|
age: 3,
|
||||||
|
bark: 'wooof wooof'
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log(dog.name,dog['color'])
|
||||||
|
|
||||||
|
dog.breed = 'rot';
|
||||||
|
dog.GetDogInfo = function(){
|
||||||
|
return `this dogs name is ${this.name} and it has good ${this.color} color it has ${this.legs} legs.`;
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log(dog.GetDogInfo())
|
Loading…
Reference in new issue