Looking for a way to dynamically generate and assign variable names to objects in javascript, I found this post on creating a sort of variable variable in Javascript. Reading the post itself, I found the answer to my immediate question. However upon reading the comments, I feel like I had a moment of clarity in my understanding of the truly awesome power of javascript, dot notation, and prototype. Why is javascript so underestimated? I see this changing in the very near future...
http://www.i-marco.nl/weblog/archive/2007/06/14/variable_variables_in_javascri
Showing posts with label prototype. Show all posts
Showing posts with label prototype. Show all posts
Javascript Variable Variables
Posted by
sarahbee
on Friday, August 7, 2009
Labels:
javascript,
object-oriented,
prototype,
variables
/
Comments: (0)
Prototype vs OOP
Posted by
sarahbee
on Wednesday, July 29, 2009
Labels:
javascript,
object-oriented,
prototype
/
Comments: (0)
Wikipedia tells me many things. Most importantly at the moment, it tells me how to move my fresh new conceptual understanding of object oriented programming over to Javascript, which is not Technically object oriented, by prototype based.
Yep, the same prototype I discovered and mentioned earlier.
Are you following along children? This rabbit hole keeps going deeper...
http://en.wikipedia.org/wiki/Prototype-based_programming
UPDATE:
This article is an excellent stepping stone for understanding prototyping in javascript. Excellent even for those with shaky knowledge of OOP.
http://www.packtpub.com/article/using-prototype-property-in-javascript
Yep, the same prototype I discovered and mentioned earlier.
Are you following along children? This rabbit hole keeps going deeper...
http://en.wikipedia.org/wiki/Prototype-based_programming
UPDATE:
This article is an excellent stepping stone for understanding prototyping in javascript. Excellent even for those with shaky knowledge of OOP.
http://www.packtpub.com/article/using-prototype-property-in-javascript
Tems: Prototype
Posted by
sarahbee
on Friday, July 24, 2009
Labels:
definition,
javascript,
object-oriented,
prototype,
terms
/
Comments: (0)
Hello again children. Today we are going to learn about a nifty little property in Javascript - PROTOTYPE.
First off, have you ever worked with objects in Javascript? Tell me about it in the comments if you have. There is some debate over whether Javascript is truly an object oriented programming language or not (see here: http://javascript.crockford.com/javascript.html to learn why we tend to underestimate this language.) Either way, the prototype property is meant for working with javascript objects. Since I don't really know much about Object Oriented programming myself (which I plan to soon change!), I can't honestly give you a full run down on what it means/does. I'm just going to tell you the gist and give you the link so you can read for yourself.
Basically the idea is by using someObject.prototype.someMethodOrValue = something, you are in fact assigning that method or value to all instances of this object.
I have a hunch that this little feature may be at the heart of what makes JS object oriented. But I think I'll have to get back to you on that once I actually KNOW something about it. In the meantime, read about it for yourself.
Ta ta for now!
First off, have you ever worked with objects in Javascript? Tell me about it in the comments if you have. There is some debate over whether Javascript is truly an object oriented programming language or not (see here: http://javascript.crockford.com/javascript.html to learn why we tend to underestimate this language.) Either way, the prototype property is meant for working with javascript objects. Since I don't really know much about Object Oriented programming myself (which I plan to soon change!), I can't honestly give you a full run down on what it means/does. I'm just going to tell you the gist and give you the link so you can read for yourself.
Basically the idea is by using someObject.prototype.someMethodOrValue = something, you are in fact assigning that method or value to all instances of this object.
I have a hunch that this little feature may be at the heart of what makes JS object oriented. But I think I'll have to get back to you on that once I actually KNOW something about it. In the meantime, read about it for yourself.
Ta ta for now!