Friday, July 18th, 2008

Semantic Constructors

Category: Prototype, Tip


This monkey patch by kangax allows you to get sense from inspecting a constructor setup via Prototype.

His code changes a simple person class from:

< view plain text >
  1. Person + ''; // "function klass() { this.initialize.apply(this, arguments); }"


< view plain text >
  1. Person + ''; // "function (name) { = name; }"

If you want more help with Prototype and you can check out their newly changed support list.

Related Content:

Posted by Dion Almaer at 5:37 am
Comment here

3.5 rating from 21 votes

Comments Here »

Comments feed TrackBack URI

Leave a comment

You must be logged in to post a comment.