From a language design perspective, if Javascript objects are simply associative arrays, then why ha
Posted
by Christopher Altman
on Stack Overflow
See other posts from Stack Overflow
or by Christopher Altman
Published on 2010-03-30T16:19:02Z
Indexed on
2010/04/14
3:13 UTC
Read the original article
Hit count: 678
I was reading about objects in O'Reilly Javascript Pocket Reference and the book made the following statement.
An object is a compound data type that contains any number of properties.
Javascript objects are associative arrays: they associate arbitrary data values with arbitrary names.
From a language design perspective, if objects are simply associative arrays, then why have objects?
I appreciate the convenience of having objects in the language, but if convenience is the main purpose for adding a data type, then how do you decide what to add and what to not add in a language? A language can quickly become bloated and less valuable if it is weighed down by several overlapping methods and data types (Is this a true statement or am I missing something).
© Stack Overflow or respective owner