1var obj = { "a" : 1, "b" : 2, "c" : 3};
2alert(Object.keys(obj));
3// will output ["a", "b", "c"]
4
1var buttons = {
2 foo: 'bar',
3 fiz: 'buz'
4};
5
6for ( var property in buttons ) {
7 console.log( property ); // Outputs: foo, fiz or fiz, foo
8}