{"action":"opened","issue":{"url":"https://api.github.com/repos/nodejs/node/issues/11570","repository_url":"https://api.github.com/repos/nodejs/node","labels_url":"https://api.github.com/repos/nodejs/node/issues/11570/labels{/name}","comments_url":"https://api.github.com/repos/nodejs/node/issues/11570/comments","events_url":"https://api.github.com/repos/nodejs/node/issues/11570/events","html_url":"https://github.com/nodejs/node/issues/11570","id":210348911,"number":11570,"title":"Confusing inspection for sparse arrays","user":{"login":"TimothyGu","id":1538624,"avatar_url":"https://avatars.githubusercontent.com/u/1538624?v=3","gravatar_id":"","url":"https://api.github.com/users/TimothyGu","html_url":"https://github.com/TimothyGu","followers_url":"https://api.github.com/users/TimothyGu/followers","following_url":"https://api.github.com/users/TimothyGu/following{/other_user}","gists_url":"https://api.github.com/users/TimothyGu/gists{/gist_id}","starred_url":"https://api.github.com/users/TimothyGu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TimothyGu/subscriptions","organizations_url":"https://api.github.com/users/TimothyGu/orgs","repos_url":"https://api.github.com/users/TimothyGu/repos","events_url":"https://api.github.com/users/TimothyGu/events{/privacy}","received_events_url":"https://api.github.com/users/TimothyGu/received_events","type":"User","site_admin":false},"labels":[{"id":155267446,"url":"https://api.github.com/repos/nodejs/node/labels/util","name":"util","color":"d4c5f9","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-02-26T21:10:13Z","updated_at":"2017-02-26T21:10:13Z","closed_at":null,"body":"<!--\r\nThank you for reporting an issue.\r\n\r\nThis issue tracker is for bugs and issues found within Node.js core.\r\nIf you require more general support please file an issue on our help\r\nrepo. https://github.com/nodejs/help\r\n\r\n\r\nPlease fill in as much of the template below as you're able.\r\n\r\nVersion: output of `node -v`\r\nPlatform: output of `uname -a` (UNIX), or version and 32 or 64-bit (Windows)\r\nSubsystem: if known, please specify affected core module name\r\n\r\nIf possible, please provide code that demonstrates the problem, keeping it as\r\nsimple and free of external dependencies as you are able.\r\n-->\r\n\r\n* **Version**: all supported versions (oldest tested branch is v4.x (4.8.0))\r\n* **Platform**: all\r\n* **Subsystem**: util\r\n\r\n<!-- Enter your issue details below this comment. -->\r\nIn the `node` REPL, sparse elements of an array are shown as \"empty\":\r\n\r\n```js\r\n> new Array(3)\r\n[ , ,  ]\r\n```\r\n\r\nHowever, when one copy the resulting `[ , ,  ]` and reenter it into the prompt, a different array is shown, thus confusing the developer:\r\n\r\n```js\r\n> [ , ,  ]\r\n[ ,  ]\r\n```\r\n\r\nHow the Chrome inspector deals with this situation is explicitly make the inspected result not compliant JS:\r\n\r\n```js\r\n> new Array(3)\r\n[undefined × 3]\r\n> [undefined, , undefined] // to differentiate between a hole and `undefined`\r\n[undefined, undefined × 1, undefined]\r\n```\r\n\r\nFirefox is more upfront:\r\n\r\n```js\r\n> new Array(3)\r\nArray [ <3 empty slots> ]\r\n> [undefined, , undefined] // to differentiate between a hole and `undefined`\r\nArray [ undefined, <1 empty slot>, undefined ]\r\n```"}}
{"actor":{"display_login":"TimothyGu"}}