We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
.hasAttribute()
prefer-dom-node-dataset
MDN suggest using in operator to check existence, I'm not sure what's the best, maybe hasOwnProperty()?
in
hasOwnProperty()
element.hasAttribute('data-foo');
"foo" in element.dataset;
The text was updated successfully, but these errors were encountered:
Yes, it should recommend .hasOwnProperty(). We can add a code TODO comment to switch to Object.hasOwn later on.
.hasOwnProperty()
Object.hasOwn
Sorry, something went wrong.
.getAttribute()
Successfully merging a pull request may close this issue.
MDN suggest using
in
operator to check existence, I'm not sure what's the best, maybehasOwnProperty()
?Fail
Pass
The text was updated successfully, but these errors were encountered: