title: how to check if a number is a float in javascript?
body: <p>Is there a method or something alike to check wether a number is a float?</p>
  
  <p>I'm receiving string arrays from server, and I need to perform some operations on the elements that compose them depending their type. I tried this to figure out the type of the elements:</p>
  
  <pre><code> let a = [4, 2.3, "SO2", 4, "O2", 3.4, 4.5, "CO2", 5.6, 3.4, 2];
  
  itExists = true;
  
   a.forEach((e,i,a)=&gt;{
     if(true){
       if(typeof e  == 'number'){        
              if ( e % 1 != 0) {
                 console.log(e + " :float")
              }else{
                  console.log(e + " :number")
               }
         }else{
           console.log(e + " :letter")
         }
     }else{
       console.log("Does not exist")
     } 
   });
  </code></pre>
  
  <p>However, this doesn't work, as they are strings. Any idea?</p>