what is difference between method and variable?
A variable is something, which stores data. A function is a bunch of code, which can be executed, if you call. ... See the following syntax: var functionname = function(){} . A method is a function of an object.