为什么啊?comefrom是一种类型吗?可否高手解释一下啊?

解决方案 »

  1.   

    function comefrom(loca,laoccity)

           this.loca=loca
           this.locacity=locacity
    }var where=new comeform('A','B')where.loca
    where.locacityexample:
    window.alert("where.loca is "+where.loca+'\n'+"where.locacity is "+where.locac
      

  2.   

    在JS中通过fucntion既可以定义个函数,也可以定义一个自定义的"数据类型!"这个class的功能是一样的!JerKii
      

  3.   

    必须用new关键字实例化,才能引用