Javascript Check If Variable Is Defined And Undefined