How to list the properties of a javascript object

/ Published in: JavaScript
Save to your folder(s)

Copy this code and paste it in your HTML
  1. var getKeys = function(obj){
  2. var keys = [];
  3. for(var key in obj){
  4. keys.push(key);
  5. }
  6. return keys;
  7. }


Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.