Array lengths cached for "for" loop, use hasOwnProperty instead of typeof !== 'undefined'