靜態方法:spa
function A(){} A.sayMeS=function(){ console.log("Hello World S!"); } A.sayMeS();//輸出Hello World S!
2.實例方法:prototype
function A(){} A.prototype.sayMeE=function(){ console.log("Hello World E!"); } var a=new A(); a.sayMeE();//輸出Hello World E!