check if number is not nan javascript