一、简单函数创建、封装第三种就是构造函数function fun(a,b){ this.firstName=a this.lastName=b } var x=new myFun(Jhon,Davi) x.firstName 输出Jhon二、实例