Docs: Reflect.getOwnPropertyNames does not exist
See original GitHub issueIn the documentation and source code for the prefer-reflect
rule, the user is instructed to use Reflect.getOwnPropertyNames
in place of Object.getOwnPropertyNames
. However, Reflect.getOwnPropertyNames
doesn’t actually exist. The closest corresponding Reflect method is Reflect.ownKeys
, although this isn’t quite the same because it also includes Symbol properties.
Issue Analytics
- State:
- Created 7 years ago
- Comments:9 (6 by maintainers)
Top Results From Across the Web
why Object.getOwnPropertyNames() does not work [duplicate]
getOwnPropertyNames () won't return properties that are inherited from the prototype. That's what "own" means -- it only returns the properties ...
Read more >Object.getOwnPropertyNames() - JavaScript - MDN Web Docs
The Object.getOwnPropertyNames() method returns an array of all properties (including non-enumerable properties except for those which use Symbol) found ...
Read more >prefer-reflect - ESLint - Pluggable JavaScript Linter
A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease.
Read more >Meta programming - JavaScript
A property cannot be reported as non-configurable if it does not exist as an ... Reflect helps with forwarding default operations from the...
Read more >JavaScript: Why Reflect APIs? - GreenRoots Blog
getOwnPropertyNames : method returns an array of all properties? Many more... So why do we need a new API when these could just...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yeah, I’m working on getting #7119 in shape for merging to address this issue.
I’m closing this because the team has decided to deprecate the
prefer-reflect
rule (see discussion here: #7226). @dwhieb Thanks for creating the issue and being willing to do the work!