title: Using typeof within a for-in loop in javascript
body: <p>I have created an object with 6 properties out of which first 3 properties are of string data type and the second 3 are of number data type. I decided to print the values of the properties of string data type alone. But my code is printing the values of all the properties available. The following is my code. Someone help me correct it.</p>
  
  <pre><code>var family = {
      dad: "Two",
      mom: "Twenty Two",
      kid: "Thirty Two",
      dadAge: 42,
      momAge: 41,
      kidAge: 12,
  
  };
  
  for(prop in family){
      if(typeof prop === "string"){
          console.log(family[prop]);
      }
  }
  </code></pre>