if (foo === undefined) { }
or for paranoid
if (foo === (void) 0)
This is something you can check directly in your JavaScript console. Just declare a variable and then use it in a (well, like) expression. What the console prints is a good hint of what you need to do.
Pointy
source share