Skip to content

Commit

Permalink
Docs: Update ambiguous for...in example for guard-for-in (#10114)
Browse files Browse the repository at this point in the history
  • Loading branch information
w3cj authored and platinumazure committed Mar 21, 2018
1 parent 0360cc2 commit 6f9e155
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions docs/rules/guard-for-in.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ for (key in foo) {
if (Object.prototype.hasOwnProperty.call(foo, key)) {
doSomething(key);
}
}

for (key in foo) {
if ({}.hasOwnProperty.call(foo, key)) {
doSomething(key);
}
Expand Down

0 comments on commit 6f9e155

Please sign in to comment.