Skip to content

Instantly share code, notes, and snippets.

@vparihar01
Created June 25, 2013 13:23
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vparihar01/5858389 to your computer and use it in GitHub Desktop.
Save vparihar01/5858389 to your computer and use it in GitHub Desktop.
for printing down the javascript [object Object] value.This get all properties values of a Javascript Object (without knowing the keys).
for(var key in objects) {
var value = objects[key];
}
Object.values = function (obj) {
var vals = [];
for( var key in obj ) {
if ( obj.hasOwnProperty(key) ) {
vals.push(obj[key]);
}
}
return vals;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment