I've been going through hell trying to figure this out, i'm sure it's not that big of a deal, perhaps i'm just tired from coding all night, but I could really use some help...
"users" is a database-like object containing user account information ( server-side, of course ), "get" is a function that returns an array of matching objects from the users array.
var users = [
{
name:"xymon",
age:19,
pass:"mypass",
time:1364101200684
},
{
name:"test",
age:19,
pass:"x",
time:1364101200993
},
{
name:"test",
age:19,
pass:"bleh",
time:1364101200992
}
];
function get(a){
}
What I'm wanting "get" to do is return properties that match the specified object (a) in an array, like so...
var matching_users = get({name:"test",age:19});
This would return the two objects in the "users" array because their properties match the specified properties in "get" so that "matching_users" would return as...
[
{
name:"test",
age:19,
pass:"x",time:1364101200993
},
{
name:"test",
age:19,
pass:"bleh",
time:1364101200992
}
]