Updated June 8th, 2019.
Sometimes your Finder windows look like this, with a whole bunch of folders flipped open:
Turns out you don’t have to close those folders one by one. You can close them all in just two keystrokes:
⌘-A, then ⌘-⬅
(Command-A, then Command-left arrow)
This works because ⌘-A “selects all” and ⌘-left arrow collapses whatever is selected. In practice it looks like this– as easy as 1, 2, 3! Actually, 4.
Click somewhere else when you’re done in order to “unselect.” Easy.