构造函数
在对象的创建过程中,我们发现Object就是构造函数;
new关键字调用构造函数就会得到一个对象。
var a=new Object('361546');
console.log(typeof a);//'object'
new关键字做了什么?
function Stu(name,age,height){
// var this={};创建新对象
this.name=name;
this.age=age;
this.height=height;
this.intr=function(){
console.log(this);//this指向这个新创建的对象
console.log(`${
this.name}同学