Skip to content

Commit

Permalink
Mentioned that other data types can be used to index objects (mdn#33892)
Browse files Browse the repository at this point in the history
* Mentioned that other data types can be used to index objects

* Fix lint issue

* Update files/en-us/web/javascript/data_structures/index.md

Co-authored-by: Joshua Chen <sidachen2003@gmail.com>

* Suggestions incorporated

* Lint and review fixed

* Update files/en-us/web/javascript/data_structures/index.md

Co-authored-by: Joshua Chen <sidachen2003@gmail.com>

* Update index.md

---------

Co-authored-by: Joshua Chen <sidachen2003@gmail.com>
  • Loading branch information
Ashish-CodeJourney and Josh-Cena authored Jun 4, 2024
1 parent 9f718b7 commit 65370f7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 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,7 @@ 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 are either [strings](#string_type) or [symbols](#symbol_type). When other types (such as numbers) are used to index objects, the values are implicitly converted to strings. 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 65370f7

Please sign in to comment.