This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
How to check for undefined members of object on legacy browsers? #5853
Labels
Milestone
You can continue the conversation there. Go to discussion →
As raised by @bryophyta in #5849 (comment), there are several ways of checking whether an method exists as a member of an object. We also have an auto-fixing ESLint rule that prevents us from using optional chaining on non-nullish values.
For example, the
window.performance.getEntriesByType
method is defined inlib.dom.d.ts
, so we need to circumvent this rule to prevent errors in production.Which options do people prefer?
The text was updated successfully, but these errors were encountered: