title: How to parse through array of objects and convert string numbers to integers
body: <p>Working with JS. I have an array of objects. Here is a sample below. You can see that all the values are strings. However, I need to convert the <code>lft</code> and <code>rgt</code> values into integers so that I can compare these values against other values held in a different array. Keeping them as strings and comparing gives me erroneous results. </p>
  
  <pre><code>nodesWithchildren
  
  :Array[1]
  0:Object
   category_id:"8"
   created_at:"2016-11-04 14:14:28"
   lft:"17"
   name:"Felt Materials"
   rgt:"22"
   updated_at:"-0001-11-30 0:00:00"
   __proto__:Object
  </code></pre>
  
  <p>I have searched through Stackoverflow and found various suggestions. All of them use for loops with parseInt which is great BUT they assume that the values either are all string numbers AND they assume that the values are held in a simple array. Not an array of objects. </p>
  
  <p>I tried using this, but this does NOT work. Probably because parseint does not like it. IN fact it crashes the page: </p>
  
  <pre><code>var nodesWithchildrenParsed =[];
   for(var i=0; nodesWithchildren.length;i++){
   nodesWithchildrenParsed[i] = parseInt(nodesWithchildren[i]);}
  </code></pre>
  
  <p>My first step is converting these values. Once I have the <code>lft</code> and <code>rgt</code> converted to integers I will run another function where I will say something like, "if lft is greater than X and rgt is less than Y then give me the name "felt materials". </p>
  
  <p>Tks ! </p>