js init : function ()

In a recent study MUI framework, see code like this:

1     init: function(options) {
2         var that = this;
3         ……
4     }

init, this one out there:

var _App = 
    init: function(options) {
        ……
        },
    ……
};
        ……

Some understand, and it's like inside java objects defines an init method, where the init method is the initialization method, here is the entire page is initialized. Similar call java: _App.init () can be.

For details statement: This is a json written, all of the function, all other variables, are used var o = {x: func, y: "", z: obj} this architecture.

This is understood to mean the class similar to var *** deemed to create an object, x: func is defined a method, y: "" is a defined attribute, z: obj is the definition of another object. Overall json similar wording {x: ***, y: ***}

 

Guess you like

Origin www.cnblogs.com/louis95/p/11313608.html