title: Correct approach to get JSON node length in JS?
body: <p>I have this simple JSON file that supposed to be one array <em>Paths</em> with 3 arrays (Path1, Path2, Path3) of objects.</p>
  <pre><code>{
      &quot;Paths&quot;:
      
          {
              &quot;Path1&quot;: [{&quot;x&quot;:&quot;4&quot;,&quot;y&quot;:&quot;182&quot;},{&quot;x&quot;:&quot;220&quot;,&quot;y&quot;:&quot;186&quot;}],
              &quot;Path2&quot;: [{&quot;x&quot;:&quot;4&quot;,&quot;y&quot;:&quot;222&quot;},{&quot;x&quot;:&quot;256&quot;,&quot;y&quot;:&quot;217&quot;}],
              &quot;Path3&quot;: [{&quot;x&quot;:&quot;6&quot;,&quot;y&quot;:&quot;170&quot;},{&quot;x&quot;:&quot;216&quot;,&quot;y&quot;:&quot;183&quot;}]
          }
      
  }
  </code></pre>
  <p>Considering an online example that I found I am doing this to get the length of <em>Paths</em> node:</p>
  <pre><code>// It's Phaser 3 (JS game framework)
  // this.cache.json.get('data') -&gt; returns me the JSON contents
  var json = this.cache.json.get('data');
  for (var pos in json.Paths) {
      var len = parseInt(json.Paths[pos].length)+1;
      console.log(len);
  }
  </code></pre>
  <p>Although it <em>works</em> I would like to know if this is the correct approach because it seems to be too much code only to get a node length.</p>
  <p>Thanks!</p>