Added hasOwnProperty() check to $.each() method when iterating object properties