javascript check if boolean has value