Skip to content

Instantly share code, notes, and snippets.

@nishinoshake
Created December 5, 2015 09:30
Show Gist options
  • Save nishinoshake/9047036432b78d549cd6 to your computer and use it in GitHub Desktop.
Save nishinoshake/9047036432b78d549cd6 to your computer and use it in GitHub Desktop.
配列のオブジェクトをひとつづつ取り出す
;(function() {
var obj = [];
obj.push({'name': 'kimura', 'value': 56});
obj.push({'name': 'kaela', 'value': 2});
obj.push({'name': 'rie', 'value': 13});
for ( var i = 0; i < obj.length; i++ ) {
for ( var key in obj[i] ) {
console.log(key + ' : ' + obj[i][key]);
}
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment