If property name is a variable, this may leads to unexpected result.
if (foo[bar]) {}
if (bar in foo) {}
In these cases if bar
is 'toString'
, 'constructor'
etc, it will be true.
if (foo[bar] === true) {}
if (Object.prototype.hasOwnProperty.call(foo, bar)) {}
Problem: foo maybe an array
, static check can't know.
Idea from prettier/prettier#10256
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too