JS类定义原型方法的两种实现的区别

    我们知道,给JavaScript类添加原形(prototype)方法是很简单的。而且常用的有下面这两种方法,可是这两种方法在使用时有区别吗?

    JScript Class:
 function JSClass()
 {
   
 }

    Extends prototype method:
 JSClass.prototype.MethodA = function()
 {

 };

    Or

 
function = JSClass.prototype.MethodA()
 {

 };

posted on 2005-03-01 10:50  birdshome  阅读(15854)  评论(15编辑  收藏  举报

导航