filter an array with multiple values on same key
<p>I try to dynamically generate a listview in jQuery. This works perfectly for the whole list, but now I need to filter/search/reduce my initial data:</p>

<pre><code>var rezepte = [
{ "name" : "Eierkopf" , "zutaten" : ["Eier", "Zucker"] , "zubereitung" : "alles schön mischen." },
{ "name" : "Käseschnitte" , "zutaten" : ["Käse", "Brot", "Paprika"] , "zubereitung" : "Käse drauf und in den Ofen" },
{ "nme" : "Gemüse-Auflauf" , "zutaten" : ["Lauch"] , "zubereitung" : "1. schneiden 2. Kochen 3. essen" }
];
</code></pre>

<p>I would like to filter/search "recipe" by a searcharray like <code>var searcharray = ["Zucker", "Paprika"]</code> resulting in:</p>

<pre><code>var result = [
{ "name" : "Eierkopf" , "zutaten" : ["Eier", "Zucker"] , "zubereitung" : "alles schön mischen." },
{ "name" : "Käseschnitte" , "Zutaten" : ["Käse", "Brot", "Paprika"] , "zubereitung" : "Käse drauf und in den Ofen" }];
</code></pre>

<p>I have tried a lot of things within the for loop: filter, map, push - but all without sucess always resuling in undefined objects.</p>

<p>I am also not sure what syntax my recipe Array should be: there must be the possibility of variable amount of "ingredients".</p>

<p>Any help and hint would be most appreciated.</p>

<p>Thanks a lot,
Andi </p>
