-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathextend.html
More file actions
29 lines (28 loc) · 840 Bytes
/
extend.html
File metadata and controls
29 lines (28 loc) · 840 Bytes
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
<script>
(function(){
let proprty, car = {
make: 'Jeep',
model: 'Wrangler',
accelerate: function(){
return this.model + ' drives away'
},
brake: function(){
return this.make + ' pulls up'
}
}
for( property in car ){
console.log( property + ': ' + car[ property ])
}
car.make = 'Ford'
car.model = 'Bronco'
car.engine = 'V6'
car.start = function(){
return this.make + 'motor is running'
}
console.log('\nCar is a ' + car.make + ' ' + car[' model'])
console.log('Engine.type: '+ car.engine)
console.log( car.start() )
console.log( car.accelerate() )
console.log(car.brake())
})()
</script>