js 复杂研究


function test_001()
{
    var t =0;
    return 
    t || out_str("t未定义"),    //1   // 执行1句;在执行2句;
    t||null                //2
}
 var obj = test_001();

 

 
function  out_str(obj)      //定义一个函数
        {
            console.log(t);
        }
        out_str.fn = out_str.prototype ={name:'张三'};  //函数对象 添加属性 fn 和 prototype  他们的值为一个 对象  {name:'张三'}
var t = out_str.prototype;
        out_str.extend = out_str.fn.extend = function() {};  //为 out_str 添加一个 extend 属性; 为out_str下的 fn 属性添加 一个 extend 

 


 


 

var F = function(e) {
        var i = this; // 这个this 就是 这个函数 F 对象 当 执行  var t = new F(e); 的时候
         console.log(this);

        console.log(this.abcdeE);  //F.abcdeE={name:"FFFF"};     ; 输出 未定义 
        console.log(this.abcdeF);   //F.prototype.abcdeF = {name:"FFFF"};  // {name: "FFFF"}

        i.index = ++d.index,
        i.config = test({}, i.config, d.config, e),    //config为扩展属性 才有定义 否则 直接 F.

        //i.config = r.extend({}, i.config, d.config, e),
        i.render()    //执行 扩展函数
    };

    //表示扩展函数
    F.prototype.render = function() {console.log("END")} 
    F.prototype.abcdeF = {name:"FFFF"};
    F.abcdeE={name:"FFFF"}; //为对象添加一个属性; 但不在扩展属性内;
    d.abcde={name:"abcde"};


d.render = function(e) {
        var t = new F(e); //传递一个对象
        return c.call(t)
    };

 

d.render = function(e) {
    var a, b, c, d, e, f, g = arguments[0] || {},   //a =b=c=d=e=f 都是未定义 ;g=传递的第一个参数

 

j = !1;    //j=false

 

posted @ 2019-09-16 22:03  enych  阅读(253)  评论(0编辑  收藏  举报