Update article.md

This commit is contained in:
rjlardizabal 2020-05-05 19:25:20 +12:00 committed by GitHub
parent c2ce2d4cbd
commit a211fc9236
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -360,7 +360,7 @@ alert( *!*key*/!* in user ); // true, property "age" exists
Why does the `in` operator exist? Isn't it enough to compare against `undefined`? Why does the `in` operator exist? Isn't it enough to compare against `undefined`?
Well, most of the time the comparison with `undefined` works fine. But there's But there's a special case when it fails, but `"in"` works correctly. Well, most of the time the comparison with `undefined` works fine. But there's a special case when it fails, but `"in"` works correctly.
It's when an object property exists, but stores `undefined`: It's when an object property exists, but stores `undefined`: