1234567891011121314151617181920212223242526272829303132 |
- let persons = [
- {
- name: 'Sergey',
- surname: 'Honcharenko',
- age: 28,
- isMarried: false,
- },
- {
- name: 'Andrew',
- surname: 'Klymchuk',
- middleName: 'Anatoliyovych',
- haveAJob: true,
- },
- {
- name: 'Alexander',
- surname: 'Slobodian',
- sex: 'male',
- hasAPet: false,
- }
- ]
- for (let key in persons) {
- for (let value in persons[key]) {
- console.log(persons[key][value])
- }
- }
- // или
- for (let item of Object.entries(persons)) {
- console.log(Object.values(item[1]))
- }
|