Functions are written once and can be accessed from different places in a web page. Functions differ from methods in that they are not necessarily associated with a particular object. Each object in JavaScript has a list of associated methods and properties. Methods are functions or actions that a particular object can perform. Methods are always associated with a particular object.
Properties are attributes of an object.
JavaScript can manipulate these properties via the object's respective methods. A statement is a single, complete JavaScript action. The following are 2 JavaScript statements. The first assigns the number 4 to a variable w . The second writes w into the HTML document, so the number 4 will appear.