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,
- }
- ];
- let str = "<table>";
- for (let key in persons) {
- str += "<tr>";
- for (let value in persons[key]) {
- str += `<td>${persons[key][value]}</td>`;
- }
- str += "</tr>";
- }
- str += "</table>";
- document.write(str);
|