Edit in JSFiddle

const handler = {
  has: function(target, key) {
    if (key in target && key.includes("ar")) {
      return true;
    }
    return false;
  }
};

const user = {
  car: 'Bentley',
  bar: 4,
  hotel: "no",
};

const proxy = new Proxy(user, handler);
document.write('car' in proxy, "<br>"); // Result -> true
document.write('car' in user, "<br>"); // Result -> true
document.write('hotel' in proxy, "<br>"); //Result -> false
document.write('hotel' in user, "<br>"); // Result -> true
document.write('spacebar' in proxy, "<br>"); // Result -> false
document.write('spacebar' in user); //Result -> false