Comparison of programming languages (associative array): Difference between revisions

Content deleted Content added
No edit summary
m JavaScript: key types
Line 264:
 
=== JavaScript ===
JavaScript (and its standardized version: [[ECMAScript]]) is a [[Prototype-based programming|prototype-based]] [[Object-oriented programming|object-oriented]] language. In JavaScript an object is a mapping from property names to values -- that is, an associative array with one caveat: since property names are strings, only string and (coerced) integer keys are allowed. Other than that difference, objects also include one feature unrelated to associative arrays: a prototype link to the object they inherit from. Doing a lookup for a property will forward the lookup to the prototype if the object does not define the property itself.
 
An object literal is written as <code>{ property1 : value1, property2 : value2, ... }</code>. For example: