SyntaxFix
Write A Post
Hire A Developer
Questions
ECMAscript edition 5 also offers you the neat methods Object.keys() and Object.getOwnPropertyNames().
Object.keys()
Object.getOwnPropertyNames()
So
Object.keys( buttons ); // ['button1', 'button2'];