Understanding window object, javascript variables