javascript check if variable is not nan