Object-Oriented Programming
ECMA-262 defines an object as: "A collection of unordered attributes whose properties can contain basic values, objects, or functions." "Strictly speaking, this is equivalent to saying that the object is a set of values that do not have a particular order. Each property and method of an object has a name, and each name is mapped to a value.
6.1 Understanding Objects
The simplest way to create an object is to create an instance of an object and then add properties and methods to it, as shown here:
var person = new Object ();p erson.name = ' Yyg ';p erson.age = 23;person.job = ' student;person.sayname () = function () { ale RT (THIS.name); }
This is the first method used by the developer, and several years later, the object arguments are the preferred mode for creating such objects. The code is as follows
var person = { ' yyg ', $, ' student ' }
JavaScript Advanced Programming Chapter sixth object-oriented programming