title: Can I select 2nd element of a 2 dimensional array by value of the first element in Javascript?
body: <p>I have a JSON response like this:</p>
  
  <pre><code> var errorLog = "[[\"comp\",\"Please add company name!\"],
                   [\"zip\",\"Please add zip code!\"],
                    ...
  </code></pre>
  
  <p>Which I'm deserializing like this:</p>
  
  <pre><code> var log = jQuery.parseJSON(errorLog);
  </code></pre>
  
  <p>Now I can access elements like this:</p>
  
  <pre><code> log[1][1] &gt; "Please add company name"
  </code></pre>
  
  <p><strong>Question</strong>:<br>
  If I have the first value <strong>comp</strong>, is there a way to directly get the 2nd value by doing:</p>
  
  <pre><code> log[comp][1]
  </code></pre>
  
  <p>without looping through the whole array. </p>
  
  <p>Thanks for help! </p>