new操作符...

	btn.onclick = function(){
		var name = document.getElementById("name").value;
		var sex = document.getElementById("sex").value;
		var cla = document.getElementById("cla").value;
		var phone = document.getElementById("phone").value;
		var user = new User(name,sex,cla,phone);
		var userJSON = JSON.stringify(user);
		findTitle(userJSON) ;
	}
}

        new  操作符怎么理解啊~~!         新手 , - - 

小学时光丶风景美
浏览 1233回答 1
1回答

stone310

创建构造函数的实例,new了有3件事,创建空对象,this指针变化,_protp_指向prototype;简单点字面理解:新的,独一无二的;
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

JavaScript