A Javascript method is a piece of code that is called by name. Basically methods allow us to keep javascript code managable. Methods can accept zero or more parameter and allways return value when executed. A methods is executed when a call to that method is made anywhere within the script scope. Method can be constructed in variety of ways.
In Javascript, their are different ways to defining method to an object.
Syntax1
Syntax2
Syntax3