javascript check if boolean value exists