transl: easier to change where mdn: dsnt work

This commit is contained in:
joaquinelio 2021-12-14 09:50:24 -03:00 committed by GitHub
parent 8d04d0d2db
commit e715c5ac3c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -161,7 +161,7 @@ for (let key in user) alert(key); // name, age (no symbols)
alert( "Direct: " + user[id] );
```
[Object.keys(user)](mdn:js/Object/keys) also ignores them. That's a part of the general "hiding symbolic properties" principle. If another script or a library loops over our object, it won't unexpectedly access a symbolic property.
[Object.keys(user)](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/keys) also ignores them. That's a part of the general "hiding symbolic properties" principle. If another script or a library loops over our object, it won't unexpectedly access a symbolic property.
In contrast, [Object.assign](mdn:js/Object/assign) copies both string and symbol properties: