Remove hasOwnProperty checks in for-loops