2020年6月26日 星期五

Enumerability and ownership of properties

原文:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Enumerability_and_ownership_of_properties

Enumerable properties whose internal enumerable flag is set to true

enumerable flag 是 預設給 透過 simple assignment 或是 property initializer 所做出來的 properties

Enumerable properties show up (出現 ?) 在 for...in loops unless the properties's key is a symbol.
意思是: if..not 替換 unless ,假若 properties的key不是一個symbol,這個key就會出現在 for...in loop裏頭。

沒有留言:

張貼留言