Skip to content

Instantly share code, notes, and snippets.

@kiyotakagoto
Created September 29, 2011 11:57
Show Gist options
  • Select an option

  • Save kiyotakagoto/1250598 to your computer and use it in GitHub Desktop.

Select an option

Save kiyotakagoto/1250598 to your computer and use it in GitHub Desktop.
JavaScriptのオブジェクトが持つプロパティ名をすべて取得
function get_properies ( obj ) {
var property, array_of_property
;
array_of_property = [];
for ( property in obj ) {
if ( obj.hasOwnProperty( property ) ) {
array_of_property.push( property );
}
}
return array_of_property;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment