Skip to content

Instantly share code, notes, and snippets.

@adrian-cid
Last active September 6, 2016 18:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adrian-cid/cb01529e0176b2374c7782cf56d6efe8 to your computer and use it in GitHub Desktop.
Save adrian-cid/cb01529e0176b2374c7782cf56d6efe8 to your computer and use it in GitHub Desktop.
Getting all properties values of a Javascript Object
//data is the object
var val = '';
var obj = data;
var obj_name = 'data';
Object.keys(obj).forEach(function (key) {
val += obj_name + '.' + key + ' = ' + obj[key] + "\n";
});
console.log(val);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment