Objects And Inheritance

TwitterFacebook
Get flash to fully experience Pearltrees
http://timkadlec.com/2008/01/using-prototypes-in-javascript/ As mentioned in my previous post , I think using prototypes is powerful enough to deserve a more detailed explanation. To start off, let me say we are talking about the prototype method here, not the JavaScript library. Prototypes allow you to easily define methods to all instances of a particular object. The beauty is that the method is applied to the prototype, so it is only stored in the memory once, but every instance of the object has access to it. Let’s use the Pet object that we created in the previous post. In case you don’t remember it or didn’t read the article (please do) here is the object again:

Using Prototypes in Javascript | TimKadlec.com

http://www.javascriptkit.com/javatutors/proto.shtml The prototype object of JavaScript No, we're not going to discuss how to construct a new version of JavaScript in this tutorial. The prototype object of JavaScript, introduced starting in JavaScript 1.1, is a prebuilt object that simplifies the process of adding custom properties/ methods to all instances of an object. I know, I'm starting to sound a little geeky already, but hay, JavaScript isn't just about fun and games...it's important to learn the serious side of it too. A little background first...

The prototype object of JavaScript

JavaScript Class Constructor vs. Object Literal: Difference in Implementation and Inheritance

There is a difference between object literal and what is called a "constructor" in JavaScript. For some reason a lot of people think that these two are interchangeable, but they are a totally different thing. Here is an example: This is most people refer to as object literal in JavaScript. http://www.davidpirek.com/blog.aspx?n=JavaScript-Class-Constructor-vs.-Object-Literal:-Difference-in-Implementation-and-Inheritance
Cloning

Douglas Crockford www.crockford.com JavaScript is the world's most misunderstood programming language . Some believe that it lacks the property of information hiding because objects cannot have private instance variables and methods. http://javascript.crockford.com/private.html

Private Members in JavaScript

last update: February 21 st 2006 Hey, I didn't know you could do that If you are a web developer and come from the same place I do, you have probably used quite a bit of Javascript in your web pages, mostly as UI glue. http://www.sergiopereira.com/articles/advjs.html

Quick guide to somewhat advanced JavaScript