class Worker {
constructor(id, name, age) {
this.id = id;
this.name = name;
this.age = age;
this.show = function () {
console.log(this.id + ' ' + this.name + ' ' + this.age);
}
}
}
const worker = new Worker(2345, 'Tom', 54);
if ('age' in worker)
console.log('yes');
/*
run:
yes
*/