title: How to access JSON-object with multiple values per key?
body: <p>At the moment I am stuck with a problem that just seems stupid, but I don't know the answer to it. </p>
  
  <p>I am trying to access this JSON-object:</p>
  
  <pre><code> var custom_fields = 
   {
     "28246": 5123,5124,5125
   }
  </code></pre>
  
  <p>I would like to get each value from that key. I would know how to access it if it was a nested-object, but it isn't sadly (it is coming from an API, which I can't change the JSON-response from sadly)</p>
  
  <p>What I tried already is the following:</p>
  
  <pre><code>for (var key in custom_fields) {
     if (custom_fields.hasOwnProperty(key)) {
        console.log(key + " -&gt; " + custom_fields[key]);
      }
  }
  </code></pre>
  
  <p>The problem here is that the result will be like this:</p>
  
  <pre><code>1 -&gt; 5
  2 -&gt; 1
  3 -&gt; 2
  4 -&gt; 3
  5 -&gt; ,
  6 -&gt; 5
  ...etc...
  </code></pre>
  
  <p>Any suggestions are welcome, I am trying to access it in javascript/Jquery.</p>
  
  <p>Thanks for helping in advance!</p>