Instead of having a function for getScreenWidth, can't we simply use |var windowWidth = window.innerWidth;| locally and use that. It's not clear that it really needs to be a method.