Comment: setTimeout is used to push the resize method onto the event queue, ensuring it actually gets evaluated after the events have completed