title: Convert a weird JSON response to an array of simple objects
body: <p>I'm trying to convert the following JSON response to a specific format to be used in a dropdown box:</p>
  <pre><code>{
  &quot;breeds&quot;: [
      {
          &quot;name&quot;: &quot;Affenpinscher&quot;,
          &quot;_links&quot;: {
              &quot;type&quot;: {
                  &quot;href&quot;: &quot;/v2/types/dog&quot;
              }
          }
      },
      {
          &quot;name&quot;: &quot;Afghan Hound&quot;,
          &quot;_links&quot;: {
              &quot;type&quot;: {
                  &quot;href&quot;: &quot;/v2/types/dog&quot;
              }
          }
      },
      {
          &quot;name&quot;: &quot;Airedale Terrier&quot;,
          &quot;_links&quot;: {
              &quot;type&quot;: {
                  &quot;href&quot;: &quot;/v2/types/dog&quot;
              }
          }
      },
      {
          &quot;name&quot;: &quot;Akbash&quot;,
          &quot;_links&quot;: {
              &quot;type&quot;: {
                  &quot;href&quot;: &quot;/v2/types/dog&quot;
              }
          }
      },
  ]}
  </code></pre>
  <p>To be used in the dropdown box, the data needs to fit this syntax:</p>
  <pre><code>items={[
              {
                label: &quot;Baby&quot;,
                value: &quot;Baby&quot;,
              },
              {
                label: &quot;Young&quot;,
                value: &quot;Young&quot;,
              },
              {
                label: &quot;Adult&quot;,
                value: &quot;Adult&quot;,
              },
              {
                label: &quot;Senior&quot;,
                value: &quot;Senior&quot;,
              },
            ]}
  </code></pre>
  <p>where both labels and values would be equal to the one &quot;name&quot; field in the JSON object, i.e.:</p>
  <pre><code>[{
        label: &quot;Afghan Hound&quot;,
        value: &quot;Afghan Hound&quot;,
   },
  ]
  </code></pre>
  <p>I've tried seemingly every object and array refactoring tool available in JS, but I don't think I'm doing it correctly. All help is greatly appreciated.</p>