underscore has a nice 'isUndefined' function