Thursday, 3 January 2013

Previous Interview Question Next Interview Question
Home

what is an oject in javascript

Objects in javascript are the core component of JavaScript.
Simply stated, an object is an aggregation (i.e., collection) of variables and functions. Ideally, the components of an object are put together in such a way that the object represents both the attributes and behavior of some "thing" being modeled in the program.
An object used to represent a stopwatch, for example, might contain a variable to represent hours, another to represent minutes, and another to represent seconds. The stopwatch object might also contain functions that manipulate those values, such as "start ()" and "stop ()". In object oriented languages, object variables are called "properties" and object functions are called "methods."
When a web page is loaded, the browser's JavaScript interpreter automatically creates objects for most of the components contained in the document. This includes -- but is not limited to -- objects for the document's forms, images, and hyperlinks. JavaScript programmers can take advantage of the properties and methods of these objects to accomplish a wide variety of tasks.
You cannot fully appreciate what an object is until you have learned more about properties and methods. Please read on.

Previous Interview Question Next Interview Question
Home

0 comments :

Post a Comment