Skip to content

Commit

Permalink
Mentioned that other data types can be used to index objects
Browse files Browse the repository at this point in the history
  • Loading branch information
Ashish-CodeJourney authored Jun 3, 2024
1 parent e2bd4ff commit 4c3d5e3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion files/en-us/web/javascript/data_structures/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,8 @@ In computer science, an object is a value in memory which is possibly referenced

### Properties

In JavaScript, objects can be seen as a collection of properties. With the [object literal syntax](/en-US/docs/Web/JavaScript/Guide/Grammar_and_types#object_literals), a limited set of properties are initialized; then properties can be added and removed. Object properties are equivalent to key-value pairs. Property keys are either [strings](#string_type) or [symbols](#symbol_type). Property values can be values of any type, including other objects, which enables building complex data structures.
In JavaScript, objects can be seen as a collection of properties. With the [object literal syntax](/en-US/docs/Web/JavaScript/Guide/Grammar_and_types#object_literals), a limited set of properties are initialized; then properties can be added and removed. Object properties are equivalent to key-value pairs. Property keys in JavaScript objects can be [strings](#string_type), [symbols](#symbol_type), [numbers](#number_type), or even [objects](#object_type) themselves, allowing for a wide range of data types to be used as keys for indexing objects.
Property values can be values of any type, including other objects, which enables building complex data structures.

There are two types of object properties: The [_data_ property](#data_property) and the [_accessor_ property](#accessor_property). Each property has corresponding _attributes_. Each attribute is accessed internally by the JavaScript engine, but you can set them through {{jsxref("Object.defineProperty()")}}, or read them through {{jsxref("Object.getOwnPropertyDescriptor()")}}. You can read more about the various nuances on the {{jsxref("Object.defineProperty()")}} page.

Expand Down

0 comments on commit 4c3d5e3

Please sign in to comment.