Javascript recreate multidimensional array : <p>I have the following multidimensional array stored in a variable named <code>posts</code></p>

<pre><code>{ID: 141, categories: ["candy", "fruits", "vegetables"]}
{ID: 142, categories: ["fruits"]}
{ID: 143, categories: ["candy", "vegetables"]}
</code></pre>

<p>Is it possible to create a new array only with items containing <code>candy</code> in the categories? </p>

<p>So the new <code>posts</code> variable will have the following array:</p>

<pre><code>{ID: 141, categories: ["candy", "fruits", "vegetables"]}
{ID: 143, categories: ["candy", "vegetables"]}
</code></pre>
