Septiembre 02, 2003

OO JavaScript

Si, aunque poca gente lo sepa, JavaScript soporta algo parecido a la programación orientada a objetos.


Se pueden hacer clases, implementar jerarquias e incluso polimorfismo.

function Employee () {
  this.name = "";
  this.dept = "general";
}
function Manager () {
  this.reports = [];
}
Manager.prototype = new Employee;

function WorkerBee () {
this.projects = [];
}
WorkerBee.prototype = new Employee;

extraido del mejor artículo que conozco (de Netscape):
Details of the Object Model

Posted by rido at Septiembre 2, 2003 02:13 AM
Comments

tal como el java mismo ;)

Posted by: mikel on Septiembre 3, 2003 02:47 AM

Nemo dat quod non habet - No one gives what he does not have

Posted by: sex with animals on Julio 8, 2004 04:02 PM

Rident stolidi verba Latina - Fools laugh at the Latin language. (Ovid)

Posted by: rape story on Julio 10, 2004 04:37 PM

A [golf] ball hitting a tree shall be deemed not to have hit the tree.
Hitting a tree is simply bad luck and has no place in a scientific game.
The player should estimate the distance the ball would have traveled if it
had not hit the tree and play the ball from there, preferably atop a nice
firm tuft of grass.
-- Donald A. Metz
lipitor

Posted by: lipitor on Agosto 5, 2004 04:50 AM

Mellita, domi adsum - Honey, I'm home

Posted by: teen webcam on Septiembre 28, 2004 11:44 PM

Materiam superabat opus - The workmanship was better than the subject matter. (Ovid)

Posted by: free family incest pictures on Octubre 1, 2004 05:22 AM

Let's remind ourselves that last year's fresh idea is today's cliche.
-- Austen Briggs
buy cialis cheap cialisWhat if nothing exists and we're all in somebody's dream? Or what's worse,
what if only that fat guy in the third row exists?
-- Woody Allen, "Without Feathers"
d rcialis cialis onlineLet's remind ourselves that last year's fresh idea is today's cliche.
-- Austen Briggs

Posted by: cialis online on Octubre 17, 2004 10:28 AM

"The combination of a number of things to make existence worthwhile."
"Yes, the philosophy of 'none,' meaning 'all.'"
-- Spock and Lincoln, "The Savage Curtain", stardate 5906.4
buy cialis cheap cialistelepression, n.:
The deep-seated guilt which stems from knowing that you did not try
hard enough to look up the number on your own and instead put the
burden on the directory assistant.
n yo -- "Sniglets", Rich Hall & Friends
cialis cialis online "The combination of a number of things to make existence worthwhile."
"Yes, the philosophy of 'none,' meaning 'all.'"
-- Spock and Lincoln, "The Savage Curtain", stardate 5906.4

Posted by: cialis online on Octubre 19, 2004 12:36 AM
Post a comment