The stock market crashed and the US was in a major (The Great) Depression. Our entry into WWII put the economy back on track because it gave so many people jobs (not just soldiers - we had to make things, etc.).
So by 1945, we were out of the depression and back to prosperous.