Marson,
var phone = {
brand: "meizu",
model: "m2",
ram: 2,
color: "black"
};
function filter(object, callback){
for(var key in object){
callback(key, object[key]) || delete object[key];
}
return object;
}
filter(phone, function(key, value){
return (key === 'ram' || value === 'black');
});
alert(JSON.stringify(phone, null, 4));