-
Notifications
You must be signed in to change notification settings - Fork 22.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mentioned that other data types can be used to index objects #33892
Conversation
@@ -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 was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[mdn-linter] reported by reviewdog 🐶
Property values can be values of any type, including other objects, which enables building complex data structures. | |
Property values can be values of any type, including other objects, which enables building complex data structures. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Josh-Cena does it looks good now ?
Preview URLs (comment last updated: 2024-06-04 09:34:40) |
Co-authored-by: Joshua Chen <sidachen2003@gmail.com>
I specifically asked in my review comment that you should not say "property keys can be numbers" but that "you can use numbers to index objects and the number will be converted to a string". I don't know why your last commit reverted it to the previous state. |
I don't know either, why it reverted, but you can review latest commit |
You can go to https://github.com/mdn/content/pull/33892/files to see what your whole PR is proposing to change. You should make it incorporate my suggestion |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Josh-Cena incorporated
Have you checked the files tab? I do see any difference |
Yes i checked it looks good (as you suggested earlier) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here was what I suggested
Co-authored-by: Joshua Chen <sidachen2003@gmail.com>
Okay got it why it reverted to previous state |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks
Description
Property keys in JavaScript objects can be strings, symbols, numbers, or even objects themselves, allowing for a wide range of data types to be used as keys for indexing objects.
This revised statement reflects the broader range of data types that can be used as property keys in JavaScript objects.
Mentioned that other data types can be used to index objects
Motivation
Additional details
#33872 (comment)
Related issues and pull requests
Fixes #33872