Title: Incorrect information about objects and arrays · Issue #187 · HackYourFuture-CPH/JavaScript · GitHub
Open Graph Title: Incorrect information about objects and arrays · Issue #187 · HackYourFuture-CPH/JavaScript
X Title: Incorrect information about objects and arrays · Issue #187 · HackYourFuture-CPH/JavaScript
Description: The README for JS1 week 3 alleges that JavaScript has special handling for accessing numerical properties. This is not the case. An array is an object with properties for each index thus it does not differentiate between indexes or prope...
Open Graph Description: The README for JS1 week 3 alleges that JavaScript has special handling for accessing numerical properties. This is not the case. An array is an object with properties for each index thus it does no...
X Description: The README for JS1 week 3 alleges that JavaScript has special handling for accessing numerical properties. This is not the case. An array is an object with properties for each index thus it does no...
Opengraph URL: https://github.com/HackYourFuture-CPH/JavaScript/issues/187
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Incorrect information about objects and arrays","articleBody":"[The README for JS1 week 3](https://github.com/HackYourFuture-CPH/JavaScript/blob/e2e3dbd0f8ee7a957133a09a507eeed7cf16df89/javascript1/week3/readme.md?plain=1#L40) alleges that JavaScript has special handling for accessing numerical properties. This is not the case. An array is an object with properties for each index thus it does not differentiate between indexes or properties.\r\n\r\nI regret looking into this as it kinda seems it converts indexes to string and looks up the property based on that. Knowledge I would rather have been without. 😅 \r\n\r\nOne can do a quick experiment to see this:\r\n```js\r\nconst arr = [\"apple\", \"pear\", \"orange\"];\r\nconsole.log(JSON.stringify(Object.getOwnPropertyDescriptors(arr)))\r\n```\r\nwhich yields:\r\n```json\r\n{\r\n \"0\": {\r\n \"value\": \"apple\",\r\n \"writable\": true,\r\n \"enumerable\": true,\r\n \"configurable\": true\r\n },\r\n \"1\": {\r\n \"value\": \"pear\",\r\n \"writable\": true,\r\n \"enumerable\": true,\r\n \"configurable\": true\r\n },\r\n \"2\": {\r\n \"value\": \"orange\",\r\n \"writable\": true,\r\n \"enumerable\": true,\r\n \"configurable\": true\r\n },\r\n \"length\": {\r\n \"value\": 3,\r\n \"writable\": true,\r\n \"enumerable\": false,\r\n \"configurable\": false\r\n }\r\n}\r\n```","author":{"url":"https://github.com/NVedsted","@type":"Person","name":"NVedsted"},"datePublished":"2024-11-30T19:03:49.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/187/JavaScript/issues/187"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:cab8d4fe-948f-7faf-24e5-c34e3a333729 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E878:3E4E6:3B70FBE:4F0226E:6981AAE9 |
| html-safe-nonce | ce6b41c24e860d683f22502a30a76749a376f6f66104f350138ffc5066c6b38e |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFODc4OjNFNEU2OjNCNzBGQkU6NEYwMjI2RTo2OTgxQUFFOSIsInZpc2l0b3JfaWQiOiI2NzI5MzIwMDczNzM4MTA0MDkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 2460e076d18f7c12f138772c10141ddfcfe37789eeda233f9dd80e54324bc76f |
| hovercard-subject-tag | issue:2707836364 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/HackYourFuture-CPH/JavaScript/187/issue_layout |
| twitter:image | https://opengraph.githubassets.com/397246329271ec969cdb24343e2ff17f17c9a109149e90383409cd35c8c3f98f/HackYourFuture-CPH/JavaScript/issues/187 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/397246329271ec969cdb24343e2ff17f17c9a109149e90383409cd35c8c3f98f/HackYourFuture-CPH/JavaScript/issues/187 |
| og:image:alt | The README for JS1 week 3 alleges that JavaScript has special handling for accessing numerical properties. This is not the case. An array is an object with properties for each index thus it does no... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | NVedsted |
| hostname | github.com |
| expected-hostname | github.com |
| None | e137814e266030874fd2c86863529d0622b13889eeda04148c57654b6ea84ad6 |
| turbo-cache-control | no-preview |
| go-import | github.com/HackYourFuture-CPH/JavaScript git https://github.com/HackYourFuture-CPH/JavaScript.git |
| octolytics-dimension-user_id | 29845045 |
| octolytics-dimension-user_login | HackYourFuture-CPH |
| octolytics-dimension-repository_id | 107106718 |
| octolytics-dimension-repository_nwo | HackYourFuture-CPH/JavaScript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 107106718 |
| octolytics-dimension-repository_network_root_nwo | HackYourFuture-CPH/JavaScript |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | dd58d68a7813bbec9c91422c8c35f4af33832d70 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width