You will create three Objects.
- Create an
{}
calledpet
. Assign it 4 attributes. - Using dot notation and obj['key'] syntax,
console.log()
each attribute.
- Create an
{}
calledbike
. Assign it 3 attributes & 2 methods. - Using dot notation only,
console.log()
each attribute. - Two methods should be:
- pedal:
console.log('Going faster!');
- brake:
console.log('Slowing down!');
- pedal:
- Create an
{}
calledcar
. Assign it 4 attributes and three methods. - Four attributes shoudl be:
- speed (set to
0
) - color
- brand
- model
- speed (set to
- Using dot notation only,
console.log()
each attribute. - Three methods should be:
- accelerate: increase speed +1 and console.log
this.speed
- brake: decrease the speed +1 and console.log this.speed
- toString: console log all of the current properties to tell the world about this car
- accelerate: increase speed +1 and console.log