1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- let a = {
- name: 'Sergey',
- surname: 'Honcharenko',
- age: 28,
- isMarried: false,
- }
- let b = {
- name: 'Andrew',
- surname: 'Klymchuk',
- middleName: 'Anatoliyovych',
- haveAJob: true,
- }
- let c = {
- name: 'Alexander',
- surname: 'Slobodian',
- sex: 'male',
- hasAPet: false,
- }
- if('age' in a) {
- alert('age');
- }
- if('isMarried' in a) {
- alert('isMarried');
- }
- if('middleName' in b) {
- alert('middleName');
- }
- if('haveAJob' in b) {
- alert('haveAJob');
- }
- if('sex' in c) {
- alert('sex');
- }
- if('hasAPet' in c) {
- alert('hasAPet');
- }
|