how to check if number is exponential javascript