javascript check if object not undefined or null