title: how to get max value from a nested json array
body: <p>I have a nested json array and I am trying to get the maximum value of the points attribute in this array.</p>
  <pre><code> data = {
          &quot;name&quot;: &quot;KSE100&quot;,
          &quot;children&quot;: [
              {
                  &quot;name&quot;: &quot;TECHNOLOGY &amp; COMMUNICATION&quot;,
                
                  &quot;children&quot;: [
                      {
                          &quot;name&quot;: &quot;TRG&quot;,
                         
                          'points': -21
                      },
                      {
                          &quot;name&quot;: &quot;SYS&quot;,
                      
                     
                      },
  
                  ]
              },
              {
                  &quot;name&quot;: &quot;OIL&quot;,
               
                  &quot;children&quot;: [
                      {
                          &quot;name&quot;: &quot;PPL&quot;,
                         
                          'points': 9
                      },
                      {
                          &quot;name&quot;: &quot;PSO&quot;,
                          
                          'points': -19
                      },
  
                  ]
              },
  
  
          ]
  
      }
  </code></pre>
  <p>I want the max value of points from under the children sections. I mean from under technology and oil sectors.</p>
  <p>What I've <a href="https://jsfiddle.net/yc48d9q5/" rel="nofollow noreferrer">done so far</a>:</p>
  <pre class="lang-js prettyprint-override"><code>var max;
  
  for (var i in data.children.length) {
    for (var j in data.data[i]) {
      var point = data.data[i].children[j]
    }
  }
  </code></pre>