12345678910111213141516171819202122232425262728293031 |
- 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>
- <td>${persons[key].name}</td>
- <td>${persons[key].surname}</td>
- </tr>`;
- }
- str += "</table>";
- document.write(str);
|