var phone = {
brand: "meizu",
model: "m2",
ram: 2,
color: "black"
};
function filter(object, fn){
return Object.entries(object).filter(e => fn(...e)).reduce((a,[b, c] = b) => (a[b] = c, a),{})
}
console.log(filter(phone,function(key,value){
return (key == "color" || value == 2);
}));