03
Apr
Learn how to loop through Javascript Object
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]); } }