var foo = {a1:'1',a2:'2',a3:'3'}; //獲得對象所有屬性的數組 Object.getOwnPropertyNames(foo); > [ 'a1', 'a2', 'a3' ] //獲取對象屬性的個數 Object.getOwnPropertyNames(foo).length; > 3
getOwnPropertyNames的瀏覽器支持
| Feature | Chrome | Firefox | Internet Explorer | Opera | Safari |
| Basic support | 5 | 4.0 | 9 | 12 | 5 |
