Hi,

Mostly because with Class.create() you can make use of the various
inheritance functionality in the Prototype framework.

See http://api.prototypejs.org/language/Class/create/ for more information.

Greetings,
 Johan

On Tue, May 31, 2011 at 3:26 PM, maven apache <apachemav...@gmail.com>wrote:

> Hi:
>
> I am using prototype1.4 now.
>
> When create new class using prototype ,people used to use this manner:
>
> var Person = Class.create();
> Person.prototype = {
>    initialize: function(name) {
>      this.name = name;
>    }
>    printName: function() {
>      alert(this.name);
>    }
> }
>
> However I can not see the advantage of this manner,since it is very
> readable when use the native javascript:
>
> function Person(name) {
>     this.name = name;
> }
> Person.prototype = {
>     printName: function() {
>         alert(this.name);
>     }
> }
>
> Anyone can tell me why?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Prototype & script.aculo.us" group.
> To post to this group, send email to
> prototype-scriptaculous@googlegroups.com.
> To unsubscribe from this group, send email to
> prototype-scriptaculous+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/prototype-scriptaculous?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com.
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en.

Reply via email to