javascript check if boolean property exists