Last active
September 6, 2016 18:48
-
-
Save adrian-cid/cb01529e0176b2374c7782cf56d6efe8 to your computer and use it in GitHub Desktop.
Getting all properties values of a Javascript Object
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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