function Person(age){
this.age = age;
}
Person.sing = function(){console.log('我会唱歌');}
Person.prototype.getAge = function(){console.log(this.age);}
Person.age = 20;
var p = new Person(18);
console.log(Person.prototype.constructor);
上述代码中的如果要调用sing()函数则需通过Person.sing()的方式进行调用,因为sing()是属于person.sing的静态方法,如果是用new实例进行调用的话,比如p.sing(),由于在原型对象上找不到相关的sing()函数,所以会报is not function错误