Object:
All things in JavaScript are objects: strings, numbers, arrays, functions ...
In addition, JavaScript allows custom objects to be customized.
Create: Var myobject={}; Declare object literal variable
Add Value: var myobject.name= "Jener";
var myobject.age=25;
Code format:
var person = {
Name: "Zhangsan",
AGE:25,
Say:function () {
Alert ("Speak Chinese");
}
}
Grammar: Point syntax person.name; Person.say ();
prototype of the constructor Person.prototype = { say:function () { console.log (' I am saying '); } } constructor Function Person () { // Hermit action //var this = Object.create (person.prototype); Returns the setting of the object property this.name = ' lyl '; This.age =; Hermit operation //return this; } var person1 = new Person (); Console.log (Person1.name); Lyl Person1.say ();//i am saying
Object of Java Script Foundation