I. Array creation method var arrayObj = new Array (); // create an Array var arrayObj = new Array ([size]); // create an Array and specify the length, note that it is not the upper limit. It is the length var arrayObj = new Array ([element0 [, element1 [,... [, elementN]); // create an array and assign values. Although the length is specified in the second method, but in fact, in all cases, the array is longer, that is, even if the length is set to 5, the elements can still be stored outside the specified length. Note: The length will change accordingly. Basic operation var testGetArrValue = arrayObj [1]; // obtain the array element value arrayObj [1] = "this is a new value "; // assign a new value to the array element. 2. Object creation method. 1. Enclose var emptyObj ={}; var myObj = {'id': 1, // attribute names are enclosed in quotation marks. attributes are separated by commas: 'name': 'myname'}; // var m = new myObj (); // not supported 2. Use the function keyword to simulate class function myClass () {this. id = 5; this. name = 'myclass'; this. getName = function () {return this. name ;}} var my = new myClass (); alert (my. id); alert (my. getName (); Use function to create an object constructor var Person = function (name) {// an anonymous function, and assign this function to a Person variable, at this time, Person becomes a class this. name = name;} function Person (name) {// directly defines a function called Person to represent the Person class this. name = name;} Person. prototype = {// define the prototype field printName: function () {// define a print function alert (this. name) ;}} after you declare a class through a function, you can instantiate the class through the new operator. In this way, you can call the class member function to complete your logic var person = new Person ("Joe Smith"); // use the new operator to create a Person instance, and assign it to the variable person. printName (); // person can be considered as a reference of an instance, so you can call the member function in the Person class through this reference.