![]() |
point of objects
So, I am reading the book, "eloquent Javascript" and it must say it is a very poorly written book. It doesn't explain as to why things work the way they do in javascript and just basically says, "do this" and thats it. But that's beside the point.
What is the point of objects? all to often, I find tutorials, and other things about beginners guides on how to do things, but many of them (99.9999% of them) don't tell you what it can be used for. I had this trouble with arrays. Can someone enlighten me to what the point of objects are? Please don't just tell me, "they ar a type of value where properties can be freely added, removed, or changed". Give me a eveyrday language type of explanation. |
In Javascript everything is an object. An object is a collection of properties, and a property is association between a name and a value.
Have a look at:- https://developer.mozilla.org/en-US/...g_with_Objects Frustration - the first time you can't do it the second time. Desperation - the second time you can't do it the first time |
an object is like a row of a spreadsheet, the header row of a spreadsheet is like a class or constructor.
if i want a playlist, it would be nice to be able to sort by year, title, artist, etc. in js, each playlist item would be an object, and the list itself is an array (if you needed one). arrays are just objects that use 1, 2, and 3 instead of a, b, and c. |
| All times are GMT +1. The time now is 08:35 AM. |
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.