I have done this to detect "undefined" and works well. If you really believe this otherwise it will be better, please let me know.