返回产生的这个对象本身。
它类似于C语言中的struct。访问方式:
var ob = F1(1,2,3);
alert(ob.A);//1
alert(ob.B);//2
alert(ob.C);//3

解决方案 »

  1.   

    var ob = F1(1,2,3);
    alert(ob == window)
    alert(ob.A);//1
    alert(ob.B);//2
    alert(ob.C);//3
    alert(ob.location.href);//3
    这里的this == window正确的使用是var obj = new F(1,2,3)orvar obj = new Object();
    F.call(obj,1,2,3)
      

  2.   

    <script>
    function F1(A,B,C)
    {
    this.A=A;
    this.B=B;
    this.C=C;
    return this;//这个返回的是一个[object],有什么用吗?
    }
    F1(1,3,3)//this指的是window
    alert(new F1(1,3,3).A)//this指的是创建的对象
    </script>
      

  3.   

    this 指的是前面所对应的对象了。
      

  4.   

    一个function就是一个构造函数,其中的this指代实例化时的对象。