var a = function(){ //自定义类型函数a this.x = 1; //属性x this.y = 2; //属性y }; var b = new a; //创建对象 console.log(a.x); //调用对象属性x,返回1
本文标题:创建对象
本文链接:https://www.haomeiwen.com/subject/knlxohtx.html
网友评论