深入探討 for...in 與 Class
Object.keys() 與 for...in 的差異在於 Object.keys() 只能顯示目前 Object 的 Property,而 for...in 會連同 Prototype 的 Property 一併顯示。若 for...in 搭配 Constructor Function 或 Object.create() 時一切正常,但搭配 class 時,就無法顯示 Prototype 的 Property 了,為什麼會這樣呢 ?