Make IE8 compatible with hasOwnPropery on looping through arrays