difference between property and method javascript code example

Example 1: what is the difference between a property and method

The vehicle has: Number Plate, Brand, Model, Color. Those are properties.

The vehicle can: Turn On, Accelerate, Brake, Horn. Those are methods.

Example 2: what is the difference between a property and method

Properties define the characteristics of an object such as Size, 
Color etc. or sometimes the way in which it behaves. 
A method is an action that can be performed on objects. 
For example, a dog is an object.

Tags:

Misc Example