Replace 'mdn' link

This commit is contained in:
Osvaldo Dias dos Santos 2021-12-21 00:20:33 +01:00
parent 8d04d0d2db
commit 53488ee2d5

View file

@ -287,7 +287,7 @@ for(let prop in rabbit) alert(prop); // jumps, then eats
*/!*
```
If that's not what we want, and we'd like to exclude inherited properties, there's a built-in method [obj.hasOwnProperty(key)](mdn:js/Object/hasOwnProperty): it returns `true` if `obj` has its own (not inherited) property named `key`.
If that's not what we want, and we'd like to exclude inherited properties, there's a built-in method [obj.hasOwnProperty(key)](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwnProperty): it returns `true` if `obj` has its own (not inherited) property named `key`.
So we can filter out inherited properties (or do something else with them):