Viewing posts from: April, 2014

You can use the for-in loop as shown below. However, you also want to make sure that the key you get is an actual property of an object, and doesn’t come from the prototype: for (var key in p) { if (p.hasOwnProperty(key)) { alert(key + ” -> ” + p[key]); } }