Having the following array:
var products = [
{ title: "Product One", categories: ["one", "two"] },
{ title: "Product Two", categories: ["two", "three"] },
{ title: "Product Three", categories: ["three", "four"] }
];
How can I filter the array (I only want products which have category "two") so I get the desired result:
[
{ title: "Product One", categories: ["one", "two"] },
{ title: "Product Two", categories: ["two", "three"] }
]