title: Find corresponding product combination according to user's selection
body: <p>This corresponds to an ecommerce site.</p>
  <p>I have the following JSON corresponding to a list of combinations (sizes, colors, etc) valid for a certain product:</p>
  <pre><code>[
    {
      &quot;id&quot;: 7,
      &quot;price&quot;: 12,
      &quot;stock&quot;: 100,
      &quot;options&quot;: [
        {
          &quot;attribute_value_id&quot;: 3,
          &quot;attribute_value_name&quot;: &quot;Blue&quot;,
          &quot;attribute_id&quot;: 1,
          &quot;attribute_name&quot;: &quot;Colores&quot;,
          &quot;disabled&quot;: false,
          &quot;attribute&quot;: [
            {
              &quot;id&quot;: 1,
              &quot;name&quot;: &quot;Colores&quot;
            }
          ]
        },
        {
          &quot;attribute_value_id&quot;: 32,
          &quot;attribute_value_name&quot;: &quot;M&quot;,
          &quot;attribute_id&quot;: 4,
          &quot;attribute_name&quot;: &quot;Talla Superior&quot;,
          &quot;disabled&quot;: false,
          &quot;attribute&quot;: [
            {
              &quot;id&quot;: 4,
              &quot;name&quot;: &quot;Talla Superior&quot;
            }
          ]
        }
      ]
    },
    {
      &quot;id&quot;: 17,
      &quot;price&quot;: 7.2,
      &quot;stock&quot;: 12,
      &quot;options&quot;: [
        {
          &quot;attribute_value_id&quot;: 2,
          &quot;attribute_value_name&quot;: &quot;Cream&quot;,
          &quot;attribute_id&quot;: 1,
          &quot;attribute_name&quot;: &quot;Colores&quot;,
          &quot;disabled&quot;: false,
          &quot;attribute&quot;: [
            {
              &quot;id&quot;: 1,
              &quot;name&quot;: &quot;Colores&quot;
            }
          ]
        },
        {
          &quot;attribute_value_id&quot;: 38,
          &quot;attribute_value_name&quot;: &quot;XL&quot;,
          &quot;attribute_id&quot;: 4,
          &quot;attribute_name&quot;: &quot;Talla Superior&quot;,
          &quot;disabled&quot;: false,
          &quot;attribute&quot;: [
            {
              &quot;id&quot;: 4,
              &quot;name&quot;: &quot;Talla Superior&quot;
            }
          ]
        }
      ]
    },
    {
      &quot;id&quot;: 20,
      &quot;price&quot;: 528,
      &quot;stock&quot;: 44,
      &quot;options&quot;: [
        {
          &quot;attribute_value_id&quot;: 8,
          &quot;attribute_value_name&quot;: &quot;Purple&quot;,
          &quot;attribute_id&quot;: 1,
          &quot;attribute_name&quot;: &quot;Colores&quot;,
          &quot;disabled&quot;: false,
          &quot;attribute&quot;: [
            {
              &quot;id&quot;: 1,
              &quot;name&quot;: &quot;Colores&quot;
            }
          ]
        },
        {
          &quot;attribute_value_id&quot;: 29,
          &quot;attribute_value_name&quot;: &quot;S&quot;,
          &quot;attribute_id&quot;: 4,
          &quot;attribute_name&quot;: &quot;Talla Superior&quot;,
          &quot;disabled&quot;: false,
          &quot;attribute&quot;: [
            {
              &quot;id&quot;: 4,
              &quot;name&quot;: &quot;Talla Superior&quot;
            }
          ]
        }
      ]
    },
    {
      &quot;id&quot;: 21,
      &quot;price&quot;: 401,
      &quot;stock&quot;: 37,
      &quot;options&quot;: [
        {
          &quot;attribute_value_id&quot;: 3,
          &quot;attribute_value_name&quot;: &quot;Blue&quot;,
          &quot;attribute_id&quot;: 1,
          &quot;attribute_name&quot;: &quot;Colores&quot;,
          &quot;disabled&quot;: false,
          &quot;attribute&quot;: [
            {
              &quot;id&quot;: 1,
              &quot;name&quot;: &quot;Colores&quot;
            }
          ]
        },
        {
          &quot;attribute_value_id&quot;: 35,
          &quot;attribute_value_name&quot;: &quot;L&quot;,
          &quot;attribute_id&quot;: 4,
          &quot;attribute_name&quot;: &quot;Talla Superior&quot;,
          &quot;disabled&quot;: false,
          &quot;attribute&quot;: [
            {
              &quot;id&quot;: 4,
              &quot;name&quot;: &quot;Talla Superior&quot;
            }
          ]
        }
      ]
    }
  ]
  </code></pre>
  <p>I require the following: if the user indicates that he wants the product in color &quot;Blue&quot; and size &quot;L&quot; (ids 3 and 35 respectively) based on this array look for which option has both features so that I can then know what stock and price there is for that combination.</p>
  <p>I can't find how to do that in JavaScript/Typescript.</p>
  <p>Thank you in advance.</p>