I saw it in another implementation file (Michal's socket.js) and thought it made sense.  Reading more, the !! appears superfluous, but the typeof check still seems valuable.