title: How can I find a certain Index of a JSON array based on its content? (Javascript)
body: <p>My JSON-File is:</p>
  <pre><code>[
      {
          &quot;date&quot;:&quot;2022-W04&quot;,
          &quot;moods&quot;:[
              {&quot;mood&quot;:4,&quot;name&quot;:&quot;Dennis&quot;},
              {&quot;mood&quot;:3,&quot;name&quot;:&quot;Kevin&quot;},
              {&quot;mood&quot;:3,&quot;name&quot;:&quot;Alexandros&quot;},
              {&quot;mood&quot;:2,&quot;name&quot;:&quot;Tobias&quot;},
              {&quot;mood&quot;:0,&quot;name&quot;:&quot;Andreas&quot;}
          ]
      },
      {
          &quot;date&quot;:&quot;2022-W05&quot;,
          &quot;moods&quot;:[
              {&quot;mood&quot;:0,&quot;name&quot;:&quot;Dennis&quot;},
              {&quot;mood&quot;:0,&quot;name&quot;:&quot;Kevin&quot;},
              {&quot;mood&quot;:3,&quot;name&quot;:&quot;Alexandros&quot;},
              {&quot;mood&quot;:2,&quot;name&quot;:&quot;Tobias&quot;},
              {&quot;mood&quot;:0,&quot;name&quot;:&quot;Andreas&quot;}
          ]
      }
  ]
  </code></pre>
  <p>I now want to have the index for example for date 2022-W05 to access its data(mood and name).
  Of course I could just loop through the entire array and check for the correct date but is there a better way to get the right index?</p>