javascript check if boolean exists