JSFiddle - React, Tailwind, and code Playground
by Anid Monsur
JavaScript
var receivedQuery = [ { 'ingredients.ingredient': /^what$/i },
{ 'ingredients.ingredient': /^you$/i},
{ 'ingredients.ingredient': /^said$/i},
{ 'ingredients.ingredient': /^about$/i},
{ 'ingredients.ingredient': /^that$/i}
];
for (i = 0, max = receivedQuery.length; i < max; i++) {
var copy = receivedQuery.slice(0);
console.log(copy.splice(i, 1), copy);
};