I keep hitting a code pattern in javascript that I'm having trouble writing in a readable, non-ugly pattern. (FWIW, I'm just ...