JavaScript使用prototype定义对象类型(转)[
From: JavaEye.comprototype提供了一套JavaScript面向对象基础设施,我们可以使用它来进行面向对象编程,定义对象类型方式如下: var Person = Class.create();Person.prototype = { initialize : function(name, age) { this.name = name; this.age = age; }, toString : function() { [removed]ln(“[name]:”+this.name+””+”[age]:”+this.age); }}先使用Class.c
下载地址
用户评论