{"size": 1135, "ext": "js", "max_stars_repo_path": "scripts/01_class.js", "max_stars_repo_name": "iquanzhan/JavaScriptOO", "max_stars_repo_stars_event_min_datetime": "2018-12-02T10:33:25.000Z", "max_stars_repo_stars_event_max_datetime": "2018-12-02T10:33:25.000Z", "max_issues_repo_path": "scripts/01_class.js", "max_issues_repo_name": "iquanzhan/JavaScriptOO", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "scripts/01_class.js", "max_forks_repo_name": "iquanzhan/JavaScriptOO", "max_forks_repo_forks_event_min_datetime": "2018-12-02T10:33:34.000Z", "max_forks_repo_forks_event_max_datetime": "2018-12-02T10:33:34.000Z"}
{"max_stars_count": 1, "max_issues_count": null, "max_forks_count": 1, "avg_line_length": 11.9473684211, "max_line_length": 49, "alphanum_fraction": 0.5515418502}
function Person() {

}

/* 每一个对象的创建都有一个默认的constructor */
console.log(Person.constructor);

/* 给Person添加属性 */
Person.weight = 140;

function Student() {

}

/* 给Person对象添加了一个Student对象的属性b */
Person.b = Student;
Person.c = {
    aa: 'aa'
}



/* 实现A.B.C.E.D.F.G() */
function A() {

}

function b() {

}

function c() {

}

function d() {

}

function e() {

}

function f() {

}

function g() {
    console.log("A.B.C.D.E.F.G()");
}
A.B = b;
A.B.C = c;
A.B.C.D = d;
A.B.C.D.E = e;
A.B.C.D.E.F = f;
A.B.C.D.E.F.G = g;

A.B.C.D.E.F.G();


//使用json对象
var AA = {};
AA.BB = b;
AA.BB.CC = c;
AA.BB.CC.DD = d;
AA.BB.CC.DD.EE = e;
AA.BB.CC.DD.EE.FF = f;
AA.BB.CC.DD.EE.FF.GG = g;

AA.BB.CC.DD.EE.FF.GG();



/* 命名空间生成方法 */
function nameplace(nameplaceString) {
    var temp = [];
    var array = nameplaceString.split('.');

    for (var i = 0; i < array.length; i++) {
        temp.push(array[i]);
        /* 把多个json对象添加到window上 */
        eval('window.' + temp.join('.') + '={}');
    }
}


/* 命名空间生成 */
nameplace('com.chengxiaoxiao.jsoo');

com.chengxiaoxiao.jsoo.alert = function () {
    alert("alert");
}

com.chengxiaoxiao.jsoo.alert();
