javascript check if string is defined and not empty