Sunday, 18 August 2013

prototype and constructor in plain english?

prototype and constructor in plain english?

"Javascript is the worlds most misunderstood language"-D.Cracford
I have been using javascript for the past 6 months and was shocked when I
came to know that js is a prototype based language.
I went through some SO question about how javascript was supposed to be
used and came across prototypes and constructors.
I learned it and now I can say that I am not a noob when It comes to
Constructor and prototypes.I am familiar with the syntax.But still I think
I am missing something and havent got down to the core of this language
and I do get confused sometimes.
MyQuestion:
Constructor and protoypes in plain english?
What is the purpose behind using Prototypes and constructors?I mean do
they provide more flexibility.I am asking this as I have been using this
language for past 6 months and never had a situation where I used
prototypes and constructor.
I am not looking for any syntax and how to go about things explanations as
I do understand some part of it,just wanted to know these things in a
simpler way.An analogy or example would be great.
Hope I am clear.

No comments:

Post a Comment