Thursday, April 4, 2013

JavaScript: How to get all properties of object

While using JavaScript statement for… in, we get functions of objects. If you need only properties without functions, use that:
for (key in object) {  
   if (object.hasOwnProperty(key)) {  
      ...  
   }  
}