Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

get object key name in js

var buttons = {
  foo: 'bar',
  fiz: 'buz'
};

for ( var property in buttons ) {
  console.log( property ); // Outputs: foo, fiz or fiz, foo
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #object #key #js
ADD COMMENT
Topic
Name
9+8 =