jobo: Vererbung

Beitrag lesen

Hallo,

Hi,

Wieso erzeugst Du aber eine Instanz einer Klasse, wenn diese einen Parameter benötigt, Du den aber nicht übergibst. So ganz gefühlt scheint mir das was unlogisch zu sein.

Wie vererbst du?

nicht ich:

http://www.crockford.com/javascript/javascript.html

http://www.crockford.com/javascript/inheritance.html

"Then it gets even better with the hoozit. With the hoozit I call new constructor, pass in the gizmo that says I want hoozit to inherit from gizmo, and I also pass it a constructor. I'll also pass it an object containing additional methods that I want it to add to its prototype."

http://developer.yahoo.com/yui/theater/video.php?v=crockonjs-3

Es gibt noch das hier:

http://www.crockford.com/javascript/private.html - ist auch auf selfhtml-aktuell verlinkt.

Und das:

"You never need to use new Object() in JavaScript. Use the object literal {} instead."

Gruß

jobo