I have an array like this (with just over 3000 objects instead of the 3 here):
items = [{name:\'charlie\', age:\'16\'}, {name:\'ben\', age:\'18\'}, {name:\'s
making use of javascript magnificent function eval() which evaluates string as code at runtime, we can define a prototype method for Array type
Array.prototype.where = function (query) {
var newArray = [];
for(var i=0; i
and use it with any array, passing the query as string
var newArray= items.where('.age >= 18');