javascript check if boolean variable is true