object exercise 1 finished.

pull/162/head
ardaninsaturnu 3 years ago
parent 5176d7c514
commit 4207b5d30d

@ -50,3 +50,5 @@ countries.length % 2 === 0 ?
console.log(countries.slice( 0,6 ),countries.slice( 6,12 ));

@ -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…
Cancel
Save